2015-12-30 12:20:41 -05:00
|
|
|
package image
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2016-09-06 14:46:37 -04:00
|
|
|
"github.com/docker/docker/api/types"
|
2016-03-16 19:07:41 -04:00
|
|
|
"github.com/docker/docker/api/types/backend"
|
2016-09-06 14:46:37 -04:00
|
|
|
"github.com/docker/docker/api/types/registry"
|
2016-03-08 21:18:53 -05:00
|
|
|
"golang.org/x/net/context"
|
2015-12-30 12:20:41 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// Backend is all the methods that need to be implemented
|
|
|
|
// to provide image specific functionality.
|
|
|
|
type Backend interface {
|
|
|
|
containerBackend
|
|
|
|
imageBackend
|
|
|
|
importExportBackend
|
|
|
|
registryBackend
|
|
|
|
}
|
|
|
|
|
|
|
|
type containerBackend interface {
|
2016-03-16 19:07:41 -04:00
|
|
|
Commit(name string, config *backend.ContainerCommitConfig) (imageID string, err error)
|
2015-12-30 12:20:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type imageBackend interface {
|
|
|
|
ImageDelete(imageRef string, force, prune bool) ([]types.ImageDelete, error)
|
|
|
|
ImageHistory(imageName string) ([]*types.ImageHistory, error)
|
2016-10-03 15:17:39 -04:00
|
|
|
Images(filterArgs string, filter string, all bool, withExtraAttrs bool) ([]*types.ImageSummary, error)
|
2015-12-30 12:20:41 -05:00
|
|
|
LookupImage(name string) (*types.ImageInspect, error)
|
2016-04-07 17:29:18 -04:00
|
|
|
TagImage(imageName, repository, tag string) error
|
2016-08-23 19:25:43 -04:00
|
|
|
ImagesPrune(config *types.ImagesPruneConfig) (*types.ImagesPruneReport, error)
|
2015-12-30 12:20:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type importExportBackend interface {
|
2016-01-27 17:09:42 -05:00
|
|
|
LoadImage(inTar io.ReadCloser, outStream io.Writer, quiet bool) error
|
2016-04-07 17:29:18 -04:00
|
|
|
ImportImage(src string, repository, tag string, msg string, inConfig io.ReadCloser, outStream io.Writer, changes []string) error
|
2015-12-30 12:20:41 -05:00
|
|
|
ExportImage(names []string, outStream io.Writer) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type registryBackend interface {
|
2016-04-07 17:29:18 -04:00
|
|
|
PullImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error
|
|
|
|
PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error
|
2016-06-01 16:38:14 -04:00
|
|
|
SearchRegistryForImages(ctx context.Context, filtersArgs string, term string, limit int, authConfig *types.AuthConfig, metaHeaders map[string][]string) (*registry.SearchResults, error)
|
2015-12-30 12:20:41 -05:00
|
|
|
}
|