Documentation ¶
Index ¶
- Variables
- func NewExecutor(client engineapi.APIClient, genericResources []*api.GenericResource) exec.Executor
- type StubAPIClient
- func (sa *StubAPIClient) ContainerCreate(ctx context.Context, config *container.Config, ...) (container.ContainerCreateCreatedBody, error)
- func (sa *StubAPIClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
- func (sa *StubAPIClient) ContainerKill(ctx context.Context, containerID, signal string) error
- func (sa *StubAPIClient) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error
- func (sa *StubAPIClient) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
- func (sa *StubAPIClient) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error
- func (sa *StubAPIClient) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)
- func (sa *StubAPIClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrImageRequired returned if a task is missing the image definition. ErrImageRequired = errors.New("dockerexec: image required") // ErrContainerDestroyed returned when a container is prematurely destroyed // during a wait call. ErrContainerDestroyed = errors.New("dockerexec: container destroyed") // ErrContainerUnhealthy returned if controller detects the health check failure ErrContainerUnhealthy = errors.New("dockerexec: unhealthy container") )
Functions ¶
func NewExecutor ¶
NewExecutor returns an executor from the docker client.
Types ¶
type StubAPIClient ¶
type StubAPIClient struct { client.APIClient ContainerCreateFn func(_ context.Context, config *container.Config, hostConfig *container.HostConfig, networking *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) ContainerInspectFn func(_ context.Context, containerID string) (types.ContainerJSON, error) ContainerKillFn func(_ context.Context, containerID, signal string) error ContainerRemoveFn func(_ context.Context, containerID string, options types.ContainerRemoveOptions) error ContainerStartFn func(_ context.Context, containerID string, options types.ContainerStartOptions) error ContainerStopFn func(_ context.Context, containerID string, timeout *time.Duration) error ImagePullFn func(_ context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) EventsFn func(_ context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) // contains filtered or unexported fields }
StubAPIClient implements the client.APIClient interface, but allows you to specify the behavior of each of the methods.
func NewStubAPIClient ¶
func NewStubAPIClient() *StubAPIClient
NewStubAPIClient returns an initialized StubAPIClient
func (*StubAPIClient) ContainerCreate ¶
func (sa *StubAPIClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networking *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error)
ContainerCreate is part of the APIClient interface
func (*StubAPIClient) ContainerInspect ¶
func (sa *StubAPIClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
ContainerInspect is part of the APIClient interface
func (*StubAPIClient) ContainerKill ¶
func (sa *StubAPIClient) ContainerKill(ctx context.Context, containerID, signal string) error
ContainerKill is part of the APIClient interface
func (*StubAPIClient) ContainerRemove ¶
func (sa *StubAPIClient) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error
ContainerRemove is part of the APIClient interface
func (*StubAPIClient) ContainerStart ¶
func (sa *StubAPIClient) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
ContainerStart is part of the APIClient interface
func (*StubAPIClient) ContainerStop ¶
func (sa *StubAPIClient) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error
ContainerStop is part of the APIClient interface
func (*StubAPIClient) Events ¶
func (sa *StubAPIClient) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)
Events is part of the APIClient interface
func (*StubAPIClient) ImagePull ¶
func (sa *StubAPIClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
ImagePull is part of the APIClient interface
Click to show internal directories.
Click to hide internal directories.