Documentation ¶
Index ¶
- type ContainerConfigs
- type DockerClient
- func (c *DockerClient) CreateNetwork(ctx context.Context, networkName string) (string, error)
- func (c *DockerClient) CtrExists(ctx context.Context, containerName string) (bool, string, error)
- func (c *DockerClient) ImageExists(ctx context.Context, image string) (bool, error)
- func (c *DockerClient) NetworkExists(ctx context.Context, networkName string) (bool, string, error)
- func (c *DockerClient) Pull(ctx context.Context, image string) error
- func (c *DockerClient) RemoveCtr(ctx context.Context, containerName string) error
- func (c *DockerClient) RemoveNetwork(ctx context.Context, networkName string) error
- func (c *DockerClient) RunAndWait(ctx context.Context, conf ContainerConfigs) error
- func (c *DockerClient) RunAsync(ctx context.Context, conf ContainerConfigs) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerConfigs ¶
type ContainerConfigs struct { ContName string Container *container.Config Host *container.HostConfig Networking *network.NetworkingConfig }
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
func NewDockerClient ¶
func NewDockerClient(client *client.Client) DockerClient
func (*DockerClient) CreateNetwork ¶
Creates a network and returns the ID
func (*DockerClient) CtrExists ¶
Checks if a container exists and returns (true, ID, nil) if it does
func (*DockerClient) ImageExists ¶
func (*DockerClient) NetworkExists ¶
Checks if a network exists and returns (true, ID, nil) if it does
func (*DockerClient) RemoveCtr ¶
func (c *DockerClient) RemoveCtr(ctx context.Context, containerName string) error
func (*DockerClient) RemoveNetwork ¶
func (c *DockerClient) RemoveNetwork(ctx context.Context, networkName string) error
func (*DockerClient) RunAndWait ¶
func (c *DockerClient) RunAndWait(ctx context.Context, conf ContainerConfigs) error
Creates and starts a container and then waits for it to exit
func (*DockerClient) RunAsync ¶
func (c *DockerClient) RunAsync(ctx context.Context, conf ContainerConfigs) error
Creates and starts a container and returns without waiting
Click to show internal directories.
Click to hide internal directories.