mocks

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TestNodeID defines the ID of the swarm node for testing
	TestNodeID = "1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerDaemonMock

type DockerDaemonMock struct {
}

DockerDaemonMock mocks a DockerDaemon

func (*DockerDaemonMock) ContainerByID

func (_m *DockerDaemonMock) ContainerByID(id string) *drydocker.Container

ContainerByID mock

func (*DockerDaemonMock) Containers

func (_m *DockerDaemonMock) Containers(filters []drydocker.ContainerFilter, mode drydocker.SortMode) []*drydocker.Container

Containers mock

func (*DockerDaemonMock) DiskUsage

func (_m *DockerDaemonMock) DiskUsage() (types.DiskUsage, error)

DiskUsage mock

func (*DockerDaemonMock) DockerEnv

func (_m *DockerDaemonMock) DockerEnv() drydocker.Env

DockerEnv provides a mock function with given fields:

func (*DockerDaemonMock) EventLog

func (_m *DockerDaemonMock) EventLog() *drydocker.EventLog

EventLog mock

func (*DockerDaemonMock) Events

func (_m *DockerDaemonMock) Events() (<-chan events.Message, chan<- struct{}, error)

Events provides a mock function with given fields:

func (*DockerDaemonMock) History

func (_m *DockerDaemonMock) History(id string) ([]image.HistoryResponseItem, error)

History mock

func (*DockerDaemonMock) ImageByID

func (_m *DockerDaemonMock) ImageByID(id string) (types.ImageSummary, error)

ImageByID mock

func (*DockerDaemonMock) Images

func (_m *DockerDaemonMock) Images() ([]types.ImageSummary, error)

Images mock

func (*DockerDaemonMock) ImagesCount

func (_m *DockerDaemonMock) ImagesCount() int

ImagesCount mock

func (*DockerDaemonMock) Info

func (_m *DockerDaemonMock) Info() (types.Info, error)

Info provides a mock function with given fields:

func (*DockerDaemonMock) Inspect

func (_m *DockerDaemonMock) Inspect(id string) (types.ContainerJSON, error)

Inspect provides a mock function with given fields: id

func (*DockerDaemonMock) InspectImage

func (_m *DockerDaemonMock) InspectImage(name string) (types.ImageInspect, error)

InspectImage mock

func (*DockerDaemonMock) IsContainerRunning

func (_m *DockerDaemonMock) IsContainerRunning(id string) bool

IsContainerRunning provides a mock function with given fields: id

func (*DockerDaemonMock) Kill

func (_m *DockerDaemonMock) Kill(id string) error

Kill provides a mock function with given fields: id

func (*DockerDaemonMock) Logs

func (_m *DockerDaemonMock) Logs(id, since string, ts bool) (io.ReadCloser, error)

Logs provides a mock function with given fields: id

func (*DockerDaemonMock) NetworkAt

func (_m *DockerDaemonMock) NetworkAt(position int) (*types.NetworkResource, error)

NetworkAt mock

func (*DockerDaemonMock) NetworkInspect

func (_m *DockerDaemonMock) NetworkInspect(id string) (types.NetworkResource, error)

NetworkInspect mock

func (*DockerDaemonMock) Networks

func (_m *DockerDaemonMock) Networks() ([]types.NetworkResource, error)

Networks mock

func (*DockerDaemonMock) NetworksCount

func (_m *DockerDaemonMock) NetworksCount() int

NetworksCount mock

func (*DockerDaemonMock) Node

func (_m *DockerDaemonMock) Node(id string) (*swarm.Node, error)

Node mock

func (*DockerDaemonMock) NodeChangeAvailability

func (_m *DockerDaemonMock) NodeChangeAvailability(nodeID string, availability swarm.NodeAvailability) error

NodeChangeAvailability mock

func (*DockerDaemonMock) NodeTasks

func (_m *DockerDaemonMock) NodeTasks(nodeID string) ([]swarm.Task, error)

NodeTasks mock

func (*DockerDaemonMock) Nodes

func (_m *DockerDaemonMock) Nodes() ([]swarm.Node, error)

Nodes mock

func (*DockerDaemonMock) Ok

func (_m *DockerDaemonMock) Ok() (bool, error)

Ok mocks OK

func (*DockerDaemonMock) Prune

func (_m *DockerDaemonMock) Prune() (*drydocker.PruneReport, error)

Prune mocks prune command

func (*DockerDaemonMock) Refresh

func (_m *DockerDaemonMock) Refresh(notify func(err error))

Refresh provides a mock function with given fields: allContainers

func (*DockerDaemonMock) RefreshImages

func (_m *DockerDaemonMock) RefreshImages() error

RefreshImages mock

func (*DockerDaemonMock) RefreshNetworks

func (_m *DockerDaemonMock) RefreshNetworks() error

RefreshNetworks mock

func (*DockerDaemonMock) RemoveAllStoppedContainers

func (_m *DockerDaemonMock) RemoveAllStoppedContainers() (int, error)

RemoveAllStoppedContainers provides a mock function with given fields:

func (*DockerDaemonMock) RemoveDanglingImages

func (_m *DockerDaemonMock) RemoveDanglingImages() (int, error)

RemoveDanglingImages mock

func (*DockerDaemonMock) RemoveNetwork

func (_m *DockerDaemonMock) RemoveNetwork(id string) error

RemoveNetwork mock

func (*DockerDaemonMock) RemoveUnusedImages

func (_m *DockerDaemonMock) RemoveUnusedImages() (int, error)

RemoveUnusedImages mock

func (*DockerDaemonMock) ResolveNode

func (_m *DockerDaemonMock) ResolveNode(id string) (string, error)

ResolveNode mock

func (*DockerDaemonMock) ResolveService

func (_m *DockerDaemonMock) ResolveService(id string) (string, error)

ResolveService mock

func (*DockerDaemonMock) RestartContainer

func (_m *DockerDaemonMock) RestartContainer(id string) error

RestartContainer provides a mock function with given fields: id

func (*DockerDaemonMock) Rm

func (_m *DockerDaemonMock) Rm(id string) error

Rm provides a mock function with given fields: id

func (*DockerDaemonMock) Rmi

Rmi mock

func (*DockerDaemonMock) RunImage

func (_m *DockerDaemonMock) RunImage(image types.ImageSummary, command string) error

RunImage mock

func (*DockerDaemonMock) Service

func (_m *DockerDaemonMock) Service(id string) (*swarm.Service, error)

Service mock

func (*DockerDaemonMock) ServiceLogs

func (_m *DockerDaemonMock) ServiceLogs(id, since string, ts bool) (io.ReadCloser, error)

ServiceLogs mock

func (*DockerDaemonMock) ServiceRemove

func (_m *DockerDaemonMock) ServiceRemove(id string) error

ServiceRemove mock

func (*DockerDaemonMock) ServiceScale

func (_m *DockerDaemonMock) ServiceScale(id string, scale uint64) error

ServiceScale mock

func (*DockerDaemonMock) ServiceTasks

func (_m *DockerDaemonMock) ServiceTasks(services ...string) ([]swarm.Task, error)

ServiceTasks mock

func (*DockerDaemonMock) ServiceUpdate

func (_m *DockerDaemonMock) ServiceUpdate(id string) error

ServiceUpdate forces an update of the given service

func (*DockerDaemonMock) Services

func (_m *DockerDaemonMock) Services() ([]swarm.Service, error)

Services mock

func (*DockerDaemonMock) Sort

func (_m *DockerDaemonMock) Sort(sortMode drydocker.SortMode)

Sort provides a mock function with given fields: sortMode

func (*DockerDaemonMock) SortImages

func (_m *DockerDaemonMock) SortImages(sortMode drydocker.SortMode)

SortImages mock

func (*DockerDaemonMock) SortNetworks

func (_m *DockerDaemonMock) SortNetworks(sortMode drydocker.SortMode)

SortNetworks mock

func (*DockerDaemonMock) StackConfigs

func (_m *DockerDaemonMock) StackConfigs(stack string) ([]swarm.Config, error)

StackConfigs mock

func (*DockerDaemonMock) StackNetworks

func (_m *DockerDaemonMock) StackNetworks(stack string) ([]types.NetworkResource, error)

StackNetworks mock

func (*DockerDaemonMock) StackRemove

func (_m *DockerDaemonMock) StackRemove(stack string) error

StackRemove mock

func (*DockerDaemonMock) StackSecrets

func (_m *DockerDaemonMock) StackSecrets(stack string) ([]swarm.Secret, error)

StackSecrets mock

func (*DockerDaemonMock) StackServices

func (_m *DockerDaemonMock) StackServices(stack string) ([]swarm.Service, error)

StackServices mock

func (*DockerDaemonMock) StackTasks

func (_m *DockerDaemonMock) StackTasks(stack string) ([]swarm.Task, error)

StackTasks empty mock

func (*DockerDaemonMock) Stacks

func (_m *DockerDaemonMock) Stacks() ([]drydocker.Stack, error)

Stacks mock

func (*DockerDaemonMock) StatsChannel

func (_m *DockerDaemonMock) StatsChannel(container *drydocker.Container) (*drydocker.StatsChannel, error)

StatsChannel mocks StatsChannel

func (*DockerDaemonMock) StopContainer

func (_m *DockerDaemonMock) StopContainer(id string) error

StopContainer provides a mock function with given fields: id

func (*DockerDaemonMock) Task

func (_m *DockerDaemonMock) Task(id string) (swarm.Task, error)

Task empty mock

func (*DockerDaemonMock) Top

Top function mock

func (*DockerDaemonMock) Version

func (_m *DockerDaemonMock) Version() (*types.Version, error)

Version provides a mock function with given fields:

func (*DockerDaemonMock) VolumeInspect

func (_m *DockerDaemonMock) VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)

VolumeInspect mock

func (*DockerDaemonMock) VolumeList

func (_m *DockerDaemonMock) VolumeList(ctx context.Context) ([]*volume.Volume, error)

VolumeList mock

func (*DockerDaemonMock) VolumePrune

func (_m *DockerDaemonMock) VolumePrune(ctx context.Context) (int, error)

VolumePrune mock

func (*DockerDaemonMock) VolumeRemove

func (_m *DockerDaemonMock) VolumeRemove(ctx context.Context, volumeID string, force bool) error

VolumeRemove mock

func (*DockerDaemonMock) VolumeRemoveAll

func (_m *DockerDaemonMock) VolumeRemoveAll(ctx context.Context) (int, error)

VolumeRemoveAll mock

type SwarmDockerDaemon

type SwarmDockerDaemon struct {
	DockerDaemonMock
}

SwarmDockerDaemon mocks a DockerDaemon operating in Swarm mode

func (*SwarmDockerDaemon) Info

func (_m *SwarmDockerDaemon) Info() (types.Info, error)

Info provides a mock function with given fields:

func (*SwarmDockerDaemon) Node

func (_m *SwarmDockerDaemon) Node(id string) (*swarm.Node, error)

Node returns a node with the given id

func (*SwarmDockerDaemon) NodeTasks

func (_m *SwarmDockerDaemon) NodeTasks(nodeID string) ([]swarm.Task, error)

NodeTasks mock

func (*SwarmDockerDaemon) Nodes

func (_m *SwarmDockerDaemon) Nodes() ([]swarm.Node, error)

Nodes returns a list of nodes with 1 element

func (*SwarmDockerDaemon) ResolveNode

func (_m *SwarmDockerDaemon) ResolveNode(id string) (string, error)

ResolveNode mock

func (*SwarmDockerDaemon) ResolveService

func (_m *SwarmDockerDaemon) ResolveService(id string) (string, error)

ResolveService mock

func (*SwarmDockerDaemon) ServiceTasks

func (_m *SwarmDockerDaemon) ServiceTasks(services ...string) ([]swarm.Task, error)

ServiceTasks returns one task per service, the task belongs to node with id "1"

func (*SwarmDockerDaemon) Services

func (_m *SwarmDockerDaemon) Services() ([]swarm.Service, error)

Services returns a list of services with 1 element

Jump to

Keyboard shortcuts

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