mock

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

ContainerList returns a list with 10 container with IDs from 0 to 9.

type ImageAPIClientMock

type ImageAPIClientMock struct {
	dockerAPI.APIClient
}

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

type SwarmAPIClientMock struct {
	dockerAPI.APIClient
}

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

Jump to

Keyboard shortcuts

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