docker

package
v0.0.0-rc19 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient interface {
	ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
	ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)
	ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig,
		networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error)
	ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error
	ContainerAttach(ctx context.Context, containerID string, options container.AttachOptions) (types.HijackedResponse, error)
	ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
	Ping(ctx context.Context) (types.Ping, error)
	ContainerKill(ctx context.Context, containerID, signal string) error
}

type DockerOpts

type DockerOpts struct {
	Volumes       map[string]string
	Mounts        []mount.Mount
	LogDriver     string
	LogOptions    map[string]string
	Image         string
	Network       string
	ContainerName string
	Command       []string
	Env           []string
	Timeout       time.Duration
	AutoRemove    bool
	AttachStdout  bool
	AttachStderr  bool
}

func (*DockerOpts) String

func (o *DockerOpts) String() string

type DockerWrapper

type DockerWrapper struct {
	// contains filtered or unexported fields
}

func NewDockerWrapper

func NewDockerWrapper(logger log.Logger) (*DockerWrapper, error)

func (*DockerWrapper) Pull

func (d *DockerWrapper) Pull(ctx context.Context, image string, opts types.ImagePullOptions) error

func (*DockerWrapper) Run

func (d *DockerWrapper) Run(ctx context.Context, opts DockerOpts) (stdout io.Reader, stderr io.Reader, err error)

type MockDockerClient

type MockDockerClient struct {
	mock.Mock
}

func (*MockDockerClient) ContainerAttach

func (m *MockDockerClient) ContainerAttach(ctx context.Context, containerID string, options container.AttachOptions) (types.HijackedResponse, error)

func (*MockDockerClient) ContainerCreate

func (m *MockDockerClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig,
	networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string,
) (container.CreateResponse, error)

func (*MockDockerClient) ContainerKill

func (m *MockDockerClient) ContainerKill(ctx context.Context, containerID, signal string) error

func (*MockDockerClient) ContainerStart

func (m *MockDockerClient) ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error

func (*MockDockerClient) ContainerWait

func (m *MockDockerClient) ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)

func (*MockDockerClient) ImageInspectWithRaw

func (m *MockDockerClient) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)

func (*MockDockerClient) ImagePull

func (m *MockDockerClient) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)

func (*MockDockerClient) Ping

func (m *MockDockerClient) Ping(ctx context.Context) (types.Ping, error)

Jump to

Keyboard shortcuts

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