github.com/getong/docker@v1.13.1/api/server/router/image/backend.go (about) 1 package image 2 3 import ( 4 "io" 5 6 "github.com/docker/docker/api/types" 7 "github.com/docker/docker/api/types/backend" 8 "github.com/docker/docker/api/types/filters" 9 "github.com/docker/docker/api/types/registry" 10 "golang.org/x/net/context" 11 ) 12 13 // Backend is all the methods that need to be implemented 14 // to provide image specific functionality. 15 type Backend interface { 16 containerBackend 17 imageBackend 18 importExportBackend 19 registryBackend 20 } 21 22 type containerBackend interface { 23 Commit(name string, config *backend.ContainerCommitConfig) (imageID string, err error) 24 } 25 26 type imageBackend interface { 27 ImageDelete(imageRef string, force, prune bool) ([]types.ImageDelete, error) 28 ImageHistory(imageName string) ([]*types.ImageHistory, error) 29 Images(imageFilters filters.Args, all bool, withExtraAttrs bool) ([]*types.ImageSummary, error) 30 LookupImage(name string) (*types.ImageInspect, error) 31 TagImage(imageName, repository, tag string) error 32 ImagesPrune(pruneFilters filters.Args) (*types.ImagesPruneReport, error) 33 } 34 35 type importExportBackend interface { 36 LoadImage(inTar io.ReadCloser, outStream io.Writer, quiet bool) error 37 ImportImage(src string, repository, tag string, msg string, inConfig io.ReadCloser, outStream io.Writer, changes []string) error 38 ExportImage(names []string, outStream io.Writer) error 39 } 40 41 type registryBackend interface { 42 PullImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error 43 PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error 44 SearchRegistryForImages(ctx context.Context, filtersArgs string, term string, limit int, authConfig *types.AuthConfig, metaHeaders map[string][]string) (*registry.SearchResults, error) 45 }