Documentation ¶
Overview ¶
Package daemon provides facilities for reading/writing v1.Image from/to a running daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetImageLoader = func() (ImageLoader, error) { cli, err := client.NewClientWithOpts(client.FromEnv) if err != nil { return nil, err } cli.NegotiateAPIVersion(context.Background()) return cli, nil }
GetImageLoader is a variable so we can override in tests.
Functions ¶
Types ¶
type Client ¶
type Client interface { NegotiateAPIVersion(ctx context.Context) ImageSave(context.Context, []string) (io.ReadCloser, error) ImageLoad(context.Context, io.Reader, bool) (types.ImageLoadResponse, error) ImageTag(context.Context, string, string) error }
Client represents the subset of a docker client that the daemon package uses.
type ImageLoader ¶
type ImageLoader interface { ImageLoad(context.Context, io.Reader, bool) (types.ImageLoadResponse, error) ImageTag(context.Context, string, string) error }
ImageLoader is an interface for testing.
type ImageOption ¶
type ImageOption func(*imageOpener) error
ImageOption is a functional option for Image.
func WithBufferedOpener ¶
func WithBufferedOpener() ImageOption
WithBufferedOpener buffers the image.
func WithClient ¶
func WithClient(client Client) ImageOption
WithClient is a functional option to allow injecting a docker client.
By default, github.com/docker/docker/client.FromEnv is used.
func WithUnbufferedOpener ¶
func WithUnbufferedOpener() ImageOption
WithUnbufferedOpener streams the image to avoid buffering.
Click to show internal directories.
Click to hide internal directories.