docker

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (*clientImpl, error)

New returns docker client.

Types

type Client

type Client interface {
	Build(ctx context.Context, file io.Reader, tag string, dockerfile string) (Log, error)
	Run(ctx context.Context, opts RuntimeOptions, tag string, cmd ...string) (string, Log, error)
	Rm(ctx context.Context, containerID string) error
	Rmi(ctx context.Context, tag string) error
	ExitCode(ctx context.Context, containerID string) (int64, error)
	Info(ctx context.Context) (types.Info, error)
}

Client is a interface of docker client

type Environments

type Environments map[string]interface{}

Environments represents a docker `-e` option.

func (Environments) ToArray

func (e Environments) ToArray() []string

ToArray returns string array of environments

type Log added in v0.2.0

type Log interface {
	ReadLine() (*LogLine, error)
}

Log is a interface represents docker log.

type LogLine added in v0.2.0

type LogLine struct {
	Timestamp time.Time
	Message   []byte
}

LogLine stores timestamp and a line.

type Moby added in v0.5.0

type Moby interface {
	ImageBuild(
		ctx context.Context,
		buildContext io.Reader,
		options types.ImageBuildOptions,
	) (types.ImageBuildResponse, error)
	ContainerCreate(
		ctx context.Context,
		config *container.Config,
		hostConfig *container.HostConfig,
		networkingConfig *network.NetworkingConfig,
		containerName string,
	) (container.ContainerCreateCreatedBody, error)
	ContainerStart(
		ctx context.Context,
		containerID string,
		options types.ContainerStartOptions,
	) error
	ContainerLogs(
		ctx context.Context,
		container string,
		options types.ContainerLogsOptions,
	) (io.ReadCloser, error)
	ContainerRemove(
		ctx context.Context,
		containerID string,
		options types.ContainerRemoveOptions,
	) error
	ImageRemove(
		ctx context.Context,
		imageID string,
		options types.ImageRemoveOptions,
	) ([]types.ImageDeleteResponseItem, error)
	ContainerWait(
		ctx context.Context,
		containerID string,
		condition container.WaitCondition,
	) (<-chan container.ContainerWaitOKBody, <-chan error)
	Info(
		ctx context.Context,
	) (types.Info, error)
}

Moby is a interface of docker client see also github.com/moby/moby/client

type RuntimeOptions

type RuntimeOptions struct {
	Environments Environments
	Volumes      Volumes
}

RuntimeOptions is a docker options.

type Volumes

type Volumes []string

Volumes represents a docker `-v` option.

func (Volumes) ToMap

func (v Volumes) ToMap() map[string]struct{}

ToMap returns map of volumes.

Directories

Path Synopsis
Package mock_docker is a generated GoMock package.
Package mock_docker is a generated GoMock package.

Jump to

Keyboard shortcuts

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