daemon

package
v0.0.0-...-ec4d356 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

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.NewEnvClient()
	if err != nil {
		return nil, err
	}
	cli.NegotiateAPIVersion(context.Background())
	return cli, nil
}

This is a variable so we can override in tests.

Functions

func Image

func Image(ref name.Reference, options ...ImageOption) (v1.Image, error)

Image provides access to an image reference from the Docker daemon, applying functional options to the underlying imageOpener before resolving the reference into a v1.Image.

func Write

func Write(tag name.Tag, img v1.Image) (string, error)

Write saves the image into the daemon as the given tag.

Types

type ImageLoader

type ImageLoader interface {
	ImageLoad(context.Context, io.Reader, bool) (types.ImageLoadResponse, error)
}

API interface for testing.

type ImageOption

type ImageOption func(*imageOpener) error

func WithBufferedOpener

func WithBufferedOpener() ImageOption

func WithUnbufferedOpener

func WithUnbufferedOpener() ImageOption

type ImageSaver

type ImageSaver interface {
	ImageSave(context.Context, []string) (io.ReadCloser, error)
}

API interface for testing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL