Documentation ¶
Overview ¶
Package docker implements runtime.Interface and runtime.Config interfaces by talking to Docker API.
Index ¶
- type Config
- type FakeClient
- func (f *FakeClient) ContainerCreate(ctx context.Context, config *containertypes.Config, ...) (containertypes.ContainerCreateCreatedBody, error)
- func (f *FakeClient) ContainerInspect(ctx context.Context, container string) (dockertypes.ContainerJSON, error)
- func (f *FakeClient) ContainerRemove(ctx context.Context, container string, ...) error
- func (f *FakeClient) ContainerStart(ctx context.Context, container string, ...) error
- func (f *FakeClient) ContainerStatPath(ctx context.Context, container, path string) (dockertypes.ContainerPathStat, error)
- func (f *FakeClient) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error
- func (f *FakeClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, dockertypes.ContainerPathStat, error)
- func (f *FakeClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, ...) error
- func (f *FakeClient) ImageList(ctx context.Context, options dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error)
- func (f *FakeClient) ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string `json:"host,omitempty"`
}
Config struct represents Docker container runtime configuration.
func DefaultConfig ¶ added in v0.2.0
func DefaultConfig() *Config
DefaultConfig returns Docker's runtime default configuration.
func (*Config) GetAddress ¶
GetAddress returns configured container runtime address.
func (*Config) New ¶
New validates Docker runtime configuration and returns configured runtime client.
func (*Config) SetAddress ¶
SetAddress sets runtime config address where it should connect.
type FakeClient ¶ added in v0.2.0
type FakeClient struct { ContainerCreateF func(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, containerName string) (containertypes.ContainerCreateCreatedBody, error) ContainerStartF func(ctx context.Context, container string, options dockertypes.ContainerStartOptions) error ContainerStopF func(ctx context.Context, container string, timeout *time.Duration) error ContainerInspectF func(ctx context.Context, container string) (dockertypes.ContainerJSON, error) ContainerRemoveF func(ctx context.Context, container string, options dockertypes.ContainerRemoveOptions) error CopyFromContainerF func(ctx context.Context, container, srcPath string) (io.ReadCloser, dockertypes.ContainerPathStat, error) CopyToContainerF func(ctx context.Context, container, path string, content io.Reader, options dockertypes.CopyToContainerOptions) error ContainerStatPathF func(ctx context.Context, container, path string) (dockertypes.ContainerPathStat, error) ImageListF func(ctx context.Context, options dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error) ImagePullF func(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error) }
FakeClient is a mock of Docker client.
func (*FakeClient) ContainerCreate ¶ added in v0.2.0
func (f *FakeClient) ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, containerName string) (containertypes.ContainerCreateCreatedBody, error)
ContainerCreate mocks Docker client ContainerCreate().
func (*FakeClient) ContainerInspect ¶ added in v0.2.0
func (f *FakeClient) ContainerInspect(ctx context.Context, container string) (dockertypes.ContainerJSON, error)
ContainerInspect mocks Docker client ContainerInspect().
func (*FakeClient) ContainerRemove ¶ added in v0.2.0
func (f *FakeClient) ContainerRemove(ctx context.Context, container string, options dockertypes.ContainerRemoveOptions) error
ContainerRemove mocks Docker client ContainerRemove().
func (*FakeClient) ContainerStart ¶ added in v0.2.0
func (f *FakeClient) ContainerStart(ctx context.Context, container string, options dockertypes.ContainerStartOptions) error
ContainerStart mocks Docker client ContainerStart().
func (*FakeClient) ContainerStatPath ¶ added in v0.2.0
func (f *FakeClient) ContainerStatPath(ctx context.Context, container, path string) (dockertypes.ContainerPathStat, error)
ContainerStatPath mocks Docker client ContainerStatPath().
func (*FakeClient) ContainerStop ¶ added in v0.2.0
func (f *FakeClient) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error
ContainerStop mocks Docker client ContainerStop().
func (*FakeClient) CopyFromContainer ¶ added in v0.2.0
func (f *FakeClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, dockertypes.ContainerPathStat, error)
CopyFromContainer mocks Docker client CopyFromContainer().
func (*FakeClient) CopyToContainer ¶ added in v0.2.0
func (f *FakeClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options dockertypes.CopyToContainerOptions) error
CopyToContainer mocks Docker client CopyToContainer().
func (*FakeClient) ImageList ¶ added in v0.2.0
func (f *FakeClient) ImageList(ctx context.Context, options dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error)
ImageList mocks Docker client ImageList().
func (*FakeClient) ImagePull ¶ added in v0.2.0
func (f *FakeClient) ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error)
ImagePull mocks Docker client ImagePull().