dockerapi

package
v0.0.0-...-967c829 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

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

func NewExecutor(client engineapi.APIClient, genericResources []*api.GenericResource) exec.Executor

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

Jump to

Keyboard shortcuts

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