Documentation ¶
Index ¶
- Constants
- type ContainerAPIClientMock
- type ImageAPIClientMock
- func (mock ImageAPIClientMock) ContainerCreate(ctx context.Context, config *container.Config, ...) (container.CreateResponse, error)
- func (mock ImageAPIClientMock) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error
- func (mock ImageAPIClientMock) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
- func (mock ImageAPIClientMock) InspectImage(ctx context.Context, image string) (types.ImageInspect, error)
- type NetworkAPIClientMock
- type SwarmAPIClientMock
- func (mock SwarmAPIClientMock) ConfigList(context context.Context, opts types.ConfigListOptions) ([]swarm.Config, error)
- func (mock SwarmAPIClientMock) NetworkList(context context.Context, opts types.NetworkListOptions) ([]types.NetworkResource, error)
- func (mock SwarmAPIClientMock) NodeList(context context.Context, options types.NodeListOptions) ([]swarm.Node, error)
- func (mock SwarmAPIClientMock) SecretList(context context.Context, opts types.SecretListOptions) ([]swarm.Secret, error)
- func (mock SwarmAPIClientMock) ServiceList(context context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
- func (mock SwarmAPIClientMock) TaskList(context context.Context, options types.TaskListOptions) ([]swarm.Task, error)
Constants ¶
const ( // LabelNamespace is the label used to track stack resources //Copied from https://github.com/docker/cli/blob/master/cli/compose/convert/compose.go LabelNamespace = "com.docker.stack.namespace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerAPIClientMock ¶
type ContainerAPIClientMock struct { dockerAPI.ContainerAPIClient Containers []types.Container }
ContainerAPIClientMock mocks docker ContainerAPIClient
func (ContainerAPIClientMock) ContainerInspect ¶
func (m ContainerAPIClientMock) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error)
ContainerInspect returns an empty inspection result.
func (ContainerAPIClientMock) ContainerList ¶
func (m ContainerAPIClientMock) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
ContainerList returns a list with 10 container with IDs from 0 to 9.
type ImageAPIClientMock ¶
ImageAPIClientMock mocks docker ImageAPIClient
func (ImageAPIClientMock) ContainerCreate ¶
func (mock ImageAPIClientMock) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error)
ContainerCreate mocks container creation
func (ImageAPIClientMock) ContainerStart ¶
func (mock ImageAPIClientMock) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error
ContainerStart mock, accepts everything without complains
func (ImageAPIClientMock) ImageInspectWithRaw ¶
func (mock ImageAPIClientMock) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
ImageInspectWithRaw mock
func (ImageAPIClientMock) InspectImage ¶
func (mock ImageAPIClientMock) InspectImage(ctx context.Context, image string) (types.ImageInspect, error)
InspectImage mock
type NetworkAPIClientMock ¶
type NetworkAPIClientMock struct {
dockerAPI.NetworkAPIClient
}
NetworkAPIClientMock mocks docker NetworkAPIClient
type SwarmAPIClientMock ¶
SwarmAPIClientMock mocks docker SwarmAPIClient
func (SwarmAPIClientMock) ConfigList ¶
func (mock SwarmAPIClientMock) ConfigList( context context.Context, opts types.ConfigListOptions) ([]swarm.Config, error)
ConfigList mock
func (SwarmAPIClientMock) NetworkList ¶
func (mock SwarmAPIClientMock) NetworkList( context context.Context, opts types.NetworkListOptions) ([]types.NetworkResource, error)
NetworkList mock
func (SwarmAPIClientMock) NodeList ¶
func (mock SwarmAPIClientMock) NodeList(context context.Context, options types.NodeListOptions) ([]swarm.Node, error)
NodeList returns a list with one Node
func (SwarmAPIClientMock) SecretList ¶
func (mock SwarmAPIClientMock) SecretList( context context.Context, opts types.SecretListOptions) ([]swarm.Secret, error)
SecretList mock
func (SwarmAPIClientMock) ServiceList ¶
func (mock SwarmAPIClientMock) ServiceList(context context.Context, options types.ServiceListOptions) ([]swarm.Service, error)
ServiceList returns a list of services
func (SwarmAPIClientMock) TaskList ¶
func (mock SwarmAPIClientMock) TaskList(context context.Context, options types.TaskListOptions) ([]swarm.Task, error)
TaskList returns a list of tasks, node with id 1 will return a non empty list