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 (
|
2018-04-19 18:30:59 -04:00
|
|
|
"context"
|
2015-12-30 12:20:41 -05:00
|
|
|
"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"
|
2022-06-02 10:36:53 -04:00
|
|
|
dockerimage "github.com/docker/docker/image"
|
2018-06-26 17:49:33 -04:00
|
|
|
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
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)
|
2021-06-22 13:09:58 -04:00
|
|
|
Images(ctx context.Context, opts types.ImageListOptions) ([]*types.ImageSummary, error)
|
2022-06-02 10:36:53 -04:00
|
|
|
GetImage(refOrID string, platform *specs.Platform) (retImg *dockerimage.Image, retErr 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
|
2021-12-22 11:21:27 -05:00
|
|
|
ImportImage(src string, repository string, platform *specs.Platform, 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 {
|
2018-06-26 17:49:33 -04:00
|
|
|
PullImage(ctx context.Context, image, tag string, platform *specs.Platform, 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
|
2022-03-02 10:03:38 -05:00
|
|
|
SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int, authConfig *types.AuthConfig, metaHeaders map[string][]string) (*registry.SearchResults, error)
|
2015-12-30 12:20:41 -05:00
|
|
|
}
|