github.com/cookieai-jar/moby@v17.12.1-ce-rc2+incompatible/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/image" 10 "github.com/docker/docker/api/types/registry" 11 "golang.org/x/net/context" 12 ) 13 14 // Backend is all the methods that need to be implemented 15 // to provide image specific functionality. 16 type Backend interface { 17 containerBackend 18 imageBackend 19 importExportBackend 20 registryBackend 21 } 22 23 type containerBackend interface { 24 Commit(name string, config *backend.ContainerCommitConfig) (imageID string, err error) 25 } 26 27 type imageBackend interface { 28 ImageDelete(imageRef string, force, prune bool) ([]types.ImageDeleteResponseItem, error) 29 ImageHistory(imageName string) ([]*image.HistoryResponseItem, error) 30 Images(imageFilters filters.Args, all bool, withExtraAttrs bool) ([]*types.ImageSummary, error) 31 LookupImage(name string) (*types.ImageInspect, error) 32 TagImage(imageName, repository, tag string) error 33 ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*types.ImagesPruneReport, error) 34 } 35 36 type importExportBackend interface { 37 LoadImage(inTar io.ReadCloser, outStream io.Writer, quiet bool) error 38 ImportImage(src string, repository, platform string, tag string, msg string, inConfig io.ReadCloser, outStream io.Writer, changes []string) error 39 ExportImage(names []string, outStream io.Writer) error 40 } 41 42 type registryBackend interface { 43 PullImage(ctx context.Context, image, tag, platform string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error 44 PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error 45 SearchRegistryForImages(ctx context.Context, filtersArgs string, term string, limit int, authConfig *types.AuthConfig, metaHeaders map[string][]string) (*registry.SearchResults, error) 46 }