Documentation ¶
Index ¶
- type Container
- type DockerClient
- type DockerService
- func (ds *DockerService) FindContainer(imageName string) *Container
- func (ds *DockerService) GetStatus() error
- func (ds *DockerService) PullImage(imageName string, registryConfig config.RegistryConfig) error
- func (ds *DockerService) RunContainer(imageName string, appCfg config.App) (*Container, error)
- func (ds *DockerService) StopContainer(containerID string) error
- func (ds *DockerService) StreamLogs(container string, tail string) error
- type ImagePullResponse
- type MockDockerClient
- func (m *MockDockerClient) Close() error
- func (m *MockDockerClient) ContainerCreate(ctx context.Context, config *container.Config, ...) (container.CreateResponse, error)
- func (m *MockDockerClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
- func (m *MockDockerClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
- func (m *MockDockerClient) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error)
- func (m *MockDockerClient) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error
- func (m *MockDockerClient) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
- func (m *MockDockerClient) ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error
- func (m *MockDockerClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerClient ¶ added in v0.0.5
type DockerClient interface { ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) Close() error }
func NewDockerClient ¶
func NewDockerClient() (DockerClient, error)
type DockerService ¶ added in v0.0.5
type DockerService struct {
Client DockerClient
}
DockerService holds the client used to interact with Docker.
func NewDockerService ¶ added in v0.0.5
func NewDockerService(cli DockerClient) *DockerService
NewDockerService creates a new instance of DockerService with the given DockerClient.
func (*DockerService) FindContainer ¶ added in v0.0.5
func (ds *DockerService) FindContainer(imageName string) *Container
func (*DockerService) GetStatus ¶ added in v0.0.7
func (ds *DockerService) GetStatus() error
func (*DockerService) PullImage ¶ added in v0.0.5
func (ds *DockerService) PullImage(imageName string, registryConfig config.RegistryConfig) error
PullImage is a function that pulls a Docker image from a Docker registry. This is similar to running `docker pull <image>` from the command line.
func (*DockerService) RunContainer ¶ added in v0.0.5
func (*DockerService) StopContainer ¶ added in v0.0.5
func (ds *DockerService) StopContainer(containerID string) error
func (*DockerService) StreamLogs ¶ added in v0.0.5
func (ds *DockerService) StreamLogs(container string, tail string) error
type ImagePullResponse ¶
type MockDockerClient ¶ added in v0.0.5
func (*MockDockerClient) Close ¶ added in v0.0.5
func (m *MockDockerClient) Close() error
Close is a mock method to simulate closing the Docker client connection
func (*MockDockerClient) ContainerCreate ¶ added in v0.0.5
func (m *MockDockerClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
ContainerCreate mocks the ContainerCreate method
func (*MockDockerClient) ContainerInspect ¶ added in v0.0.5
func (m *MockDockerClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
ContainerInspect mocks the ContainerInspect method
func (*MockDockerClient) ContainerList ¶ added in v0.0.5
func (m *MockDockerClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
ContainerList mocks the ContainerList method
func (*MockDockerClient) ContainerLogs ¶ added in v0.0.5
func (m *MockDockerClient) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error)
ContainerLogs mocks the ContainerLogs method
func (*MockDockerClient) ContainerRemove ¶ added in v0.0.7
func (m *MockDockerClient) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error
ContainerRemove mocks the ContainerRemove method
func (*MockDockerClient) ContainerStart ¶ added in v0.0.5
func (m *MockDockerClient) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
ContainerStart mocks the ContainerStart method
func (*MockDockerClient) ContainerStop ¶ added in v0.0.5
func (m *MockDockerClient) ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error
ContainerStop mocks the ContainerStop method
func (*MockDockerClient) ImagePull ¶ added in v0.0.5
func (m *MockDockerClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
ImagePull mocks the ImagePull method