2018-02-05 16:05:59 -05:00
|
|
|
package image // import "github.com/docker/docker/api/server/router/image"
|
2015-12-30 12:20:41 -05:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2016-09-06 14:46:37 -04:00
|
|
|
"github.com/docker/docker/api/types"
|
2016-11-11 09:34:01 -05:00
|
|
|
"github.com/docker/docker/api/types/filters"
|
2016-11-09 16:32:53 -05:00
|
|
|
"github.com/docker/docker/api/types/image"
|
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 {
|
|
|
|
imageBackend
|
|
|
|
importExportBackend
|
|
|
|
registryBackend
|
|
|
|
}
|
|
|
|
|
|
|
|
type imageBackend interface {
|
2016-11-10 11:27:56 -05:00
|
|
|
ImageDelete(imageRef string, force, prune bool) ([]types.ImageDeleteResponseItem, error)
|
2016-11-09 16:32:53 -05:00
|
|
|
ImageHistory(imageName string) ([]*image.HistoryResponseItem, error)
|
2016-11-11 09:34:01 -05:00
|
|
|
Images(imageFilters filters.Args, all bool, withExtraAttrs bool) ([]*types.ImageSummary, error)
|
2015-12-30 12:20:41 -05:00
|
|
|
LookupImage(name string) (*types.ImageInspect, error)
|
2018-02-09 18:24:57 -05:00
|
|
|
TagImage(imageName, repository, tag string) (string, error)
|
2017-04-11 15:52:33 -04:00
|
|
|
ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*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
|
2017-05-31 14:11:05 -04:00
|
|
|
ImportImage(src string, repository, platform string, 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 {
|
2017-05-17 16:33:33 -04:00
|
|
|
PullImage(ctx context.Context, image, tag, platform string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error
|
2016-04-07 17:29:18 -04:00
|
|
|
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
|
|
|
}
|