Documentation
¶
Overview ¶
Package docker provides a mock for using the Docker API.
Usage:
import "github.com/go-vela/worker/mock/docker"
Index ¶
- Constants
- func New() (*mock, error)
- func NewStdWriter(w io.Writer, streamType stdcopy.StdType) io.Writer
- type CheckpointService
- func (cp *CheckpointService) CheckpointCreate(_ context.Context, _ string, _ client.CheckpointCreateOptions) (client.CheckpointCreateResult, error)
- func (cp *CheckpointService) CheckpointList(_ context.Context, _ string, _ client.CheckpointListOptions) (client.CheckpointListResult, error)
- func (cp *CheckpointService) CheckpointRemove(_ context.Context, _ string, _ client.CheckpointRemoveOptions) (client.CheckpointRemoveResult, error)
- type ConfigService
- func (c *ConfigService) ConfigCreate(_ context.Context, _ client.ConfigCreateOptions) (client.ConfigCreateResult, error)
- func (c *ConfigService) ConfigInspect(_ context.Context, _ string, _ client.ConfigInspectOptions) (client.ConfigInspectResult, error)
- func (c *ConfigService) ConfigList(_ context.Context, _ client.ConfigListOptions) (client.ConfigListResult, error)
- func (c *ConfigService) ConfigRemove(_ context.Context, _ string, _ client.ConfigRemoveOptions) (client.ConfigRemoveResult, error)
- func (c *ConfigService) ConfigUpdate(_ context.Context, _ string, _ client.ConfigUpdateOptions) (client.ConfigUpdateResult, error)
- type ContainerService
- func (c *ContainerService) ContainerAttach(_ context.Context, _ string, _ client.ContainerAttachOptions) (client.ContainerAttachResult, error)
- func (c *ContainerService) ContainerCommit(_ context.Context, _ string, _ client.ContainerCommitOptions) (client.ContainerCommitResult, error)
- func (c *ContainerService) ContainerCreate(_ context.Context, opts client.ContainerCreateOptions) (client.ContainerCreateResult, error)
- func (c *ContainerService) ContainerDiff(_ context.Context, _ string, _ client.ContainerDiffOptions) (client.ContainerDiffResult, error)
- func (c *ContainerService) ContainerExport(_ context.Context, _ string, _ client.ContainerExportOptions) (client.ContainerExportResult, error)
- func (c *ContainerService) ContainerInspect(_ context.Context, ctn string, _ client.ContainerInspectOptions) (client.ContainerInspectResult, error)
- func (c *ContainerService) ContainerKill(_ context.Context, ctn string, _ client.ContainerKillOptions) (client.ContainerKillResult, error)
- func (c *ContainerService) ContainerList(_ context.Context, _ client.ContainerListOptions) (client.ContainerListResult, error)
- func (c *ContainerService) ContainerLogs(_ context.Context, ctn string, _ client.ContainerLogsOptions) (client.ContainerLogsResult, error)
- func (c *ContainerService) ContainerPause(_ context.Context, _ string, _ client.ContainerPauseOptions) (client.ContainerPauseResult, error)
- func (c *ContainerService) ContainerPrune(_ context.Context, _ client.ContainerPruneOptions) (client.ContainerPruneResult, error)
- func (c *ContainerService) ContainerRemove(_ context.Context, ctn string, _ client.ContainerRemoveOptions) (client.ContainerRemoveResult, error)
- func (c *ContainerService) ContainerRename(_ context.Context, _ string, _ client.ContainerRenameOptions) (client.ContainerRenameResult, error)
- func (c *ContainerService) ContainerResize(_ context.Context, _ string, _ client.ContainerResizeOptions) (client.ContainerResizeResult, error)
- func (c *ContainerService) ContainerRestart(_ context.Context, _ string, _ client.ContainerRestartOptions) (client.ContainerRestartResult, error)
- func (c *ContainerService) ContainerStart(_ context.Context, ctn string, _ client.ContainerStartOptions) (client.ContainerStartResult, error)
- func (c *ContainerService) ContainerStatPath(_ context.Context, _ string, _ client.ContainerStatPathOptions) (client.ContainerStatPathResult, error)
- func (c *ContainerService) ContainerStats(_ context.Context, _ string, _ client.ContainerStatsOptions) (client.ContainerStatsResult, error)
- func (c *ContainerService) ContainerStop(_ context.Context, ctn string, _ client.ContainerStopOptions) (client.ContainerStopResult, error)
- func (c *ContainerService) ContainerTop(_ context.Context, _ string, _ client.ContainerTopOptions) (client.ContainerTopResult, error)
- func (c *ContainerService) ContainerUnpause(_ context.Context, _ string, _ client.ContainerUnpauseOptions) (client.ContainerUnpauseResult, error)
- func (c *ContainerService) ContainerUpdate(_ context.Context, _ string, _ client.ContainerUpdateOptions) (client.ContainerUpdateResult, error)
- func (c *ContainerService) ContainerWait(_ context.Context, ctn string, _ client.ContainerWaitOptions) client.ContainerWaitResult
- func (c *ContainerService) CopyFromContainer(_ context.Context, _ string, opts client.CopyFromContainerOptions) (client.CopyFromContainerResult, error)
- func (c *ContainerService) CopyToContainer(_ context.Context, _ string, _ client.CopyToContainerOptions) (client.CopyToContainerResult, error)
- type DistributionService
- type ExecService
- func (e *ExecService) ExecAttach(_ context.Context, execID string, _ client.ExecAttachOptions) (client.ExecAttachResult, error)
- func (e *ExecService) ExecCreate(_ context.Context, ctnID string, opts client.ExecCreateOptions) (client.ExecCreateResult, error)
- func (e *ExecService) ExecInspect(_ context.Context, _ string, _ client.ExecInspectOptions) (client.ExecInspectResult, error)
- func (e *ExecService) ExecResize(_ context.Context, _ string, _ client.ExecResizeOptions) (client.ExecResizeResult, error)
- func (e *ExecService) ExecStart(_ context.Context, _ string, _ client.ExecStartOptions) (client.ExecStartResult, error)
- type ImageBuildService
- func (ib *ImageBuildService) BuildCachePrune(_ context.Context, _ client.BuildCachePruneOptions) (client.BuildCachePruneResult, error)
- func (ib *ImageBuildService) BuildCancel(_ context.Context, _ string, _ client.BuildCancelOptions) (client.BuildCancelResult, error)
- func (ib *ImageBuildService) ImageBuild(_ context.Context, _ io.Reader, _ client.ImageBuildOptions) (client.ImageBuildResult, error)
- type ImageService
- func (i *ImageService) ImageHistory(_ context.Context, _ string, _ ...client.ImageHistoryOption) (client.ImageHistoryResult, error)
- func (i *ImageService) ImageImport(_ context.Context, _ client.ImageImportSource, _ string, ...) (client.ImageImportResult, error)
- func (i *ImageService) ImageInspect(_ context.Context, img string, _ ...client.ImageInspectOption) (client.ImageInspectResult, error)
- func (i *ImageService) ImageList(_ context.Context, _ client.ImageListOptions) (client.ImageListResult, error)
- func (i *ImageService) ImageLoad(_ context.Context, _ io.Reader, _ ...client.ImageLoadOption) (client.ImageLoadResult, error)
- func (i *ImageService) ImagePrune(_ context.Context, _ client.ImagePruneOptions) (client.ImagePruneResult, error)
- func (i *ImageService) ImagePull(_ context.Context, image string, _ client.ImagePullOptions) (client.ImagePullResponse, error)
- func (i *ImageService) ImagePush(_ context.Context, _ string, _ client.ImagePushOptions) (client.ImagePushResponse, error)
- func (i *ImageService) ImageRemove(_ context.Context, _ string, _ client.ImageRemoveOptions) (client.ImageRemoveResult, error)
- func (i *ImageService) ImageSave(_ context.Context, _ []string, _ ...client.ImageSaveOption) (client.ImageSaveResult, error)
- func (i *ImageService) ImageTag(_ context.Context, _ client.ImageTagOptions) (client.ImageTagResult, error)
- type NetworkService
- func (n *NetworkService) NetworkConnect(_ context.Context, _ string, _ client.NetworkConnectOptions) (client.NetworkConnectResult, error)
- func (n *NetworkService) NetworkCreate(_ context.Context, name string, _ client.NetworkCreateOptions) (client.NetworkCreateResult, error)
- func (n *NetworkService) NetworkDisconnect(_ context.Context, _ string, _ client.NetworkDisconnectOptions) (client.NetworkDisconnectResult, error)
- func (n *NetworkService) NetworkInspect(_ context.Context, networkID string, _ client.NetworkInspectOptions) (client.NetworkInspectResult, error)
- func (n *NetworkService) NetworkList(_ context.Context, _ client.NetworkListOptions) (client.NetworkListResult, error)
- func (n *NetworkService) NetworkPrune(_ context.Context, _ client.NetworkPruneOptions) (client.NetworkPruneResult, error)
- func (n *NetworkService) NetworkRemove(_ context.Context, network string, _ client.NetworkRemoveOptions) (client.NetworkRemoveResult, error)
- type NodeService
- func (n *NodeService) NodeInspect(_ context.Context, _ string, _ client.NodeInspectOptions) (client.NodeInspectResult, error)
- func (n *NodeService) NodeList(_ context.Context, _ client.NodeListOptions) (client.NodeListResult, error)
- func (n *NodeService) NodeRemove(_ context.Context, _ string, _ client.NodeRemoveOptions) (client.NodeRemoveResult, error)
- func (n *NodeService) NodeUpdate(_ context.Context, _ string, _ client.NodeUpdateOptions) (client.NodeUpdateResult, error)
- type PluginService
- func (p *PluginService) PluginCreate(_ context.Context, _ io.Reader, _ client.PluginCreateOptions) (client.PluginCreateResult, error)
- func (p *PluginService) PluginDisable(_ context.Context, _ string, _ client.PluginDisableOptions) (client.PluginDisableResult, error)
- func (p *PluginService) PluginEnable(_ context.Context, _ string, _ client.PluginEnableOptions) (client.PluginEnableResult, error)
- func (p *PluginService) PluginInspect(_ context.Context, _ string, _ client.PluginInspectOptions) (client.PluginInspectResult, error)
- func (p *PluginService) PluginInstall(_ context.Context, _ string, _ client.PluginInstallOptions) (client.PluginInstallResult, error)
- func (p *PluginService) PluginList(_ context.Context, _ client.PluginListOptions) (client.PluginListResult, error)
- func (p *PluginService) PluginPush(_ context.Context, _ string, _ client.PluginPushOptions) (client.PluginPushResult, error)
- func (p *PluginService) PluginRemove(_ context.Context, _ string, _ client.PluginRemoveOptions) (client.PluginRemoveResult, error)
- func (p *PluginService) PluginSet(_ context.Context, _ string, _ client.PluginSetOptions) (client.PluginSetResult, error)
- func (p *PluginService) PluginUpgrade(_ context.Context, _ string, _ client.PluginUpgradeOptions) (client.PluginUpgradeResult, error)
- type RegistryService
- type SecretService
- func (s *SecretService) SecretCreate(_ context.Context, _ client.SecretCreateOptions) (client.SecretCreateResult, error)
- func (s *SecretService) SecretInspect(_ context.Context, _ string, _ client.SecretInspectOptions) (client.SecretInspectResult, error)
- func (s *SecretService) SecretList(_ context.Context, _ client.SecretListOptions) (client.SecretListResult, error)
- func (s *SecretService) SecretRemove(_ context.Context, _ string, _ client.SecretRemoveOptions) (client.SecretRemoveResult, error)
- func (s *SecretService) SecretUpdate(_ context.Context, _ string, _ client.SecretUpdateOptions) (client.SecretUpdateResult, error)
- type ServiceService
- func (s *ServiceService) ServiceCreate(_ context.Context, _ client.ServiceCreateOptions) (client.ServiceCreateResult, error)
- func (s *ServiceService) ServiceInspect(_ context.Context, _ string, _ client.ServiceInspectOptions) (client.ServiceInspectResult, error)
- func (s *ServiceService) ServiceList(_ context.Context, _ client.ServiceListOptions) (client.ServiceListResult, error)
- func (s *ServiceService) ServiceLogs(_ context.Context, _ string, _ client.ServiceLogsOptions) (client.ServiceLogsResult, error)
- func (s *ServiceService) ServiceRemove(_ context.Context, _ string, _ client.ServiceRemoveOptions) (client.ServiceRemoveResult, error)
- func (s *ServiceService) ServiceUpdate(_ context.Context, _ string, _ client.ServiceUpdateOptions) (client.ServiceUpdateResult, error)
- type SwarmService
- func (s *SwarmService) SwarmGetUnlockKey(_ context.Context) (client.SwarmGetUnlockKeyResult, error)
- func (s *SwarmService) SwarmInit(_ context.Context, _ client.SwarmInitOptions) (client.SwarmInitResult, error)
- func (s *SwarmService) SwarmInspect(_ context.Context, _ client.SwarmInspectOptions) (client.SwarmInspectResult, error)
- func (s *SwarmService) SwarmJoin(_ context.Context, _ client.SwarmJoinOptions) (client.SwarmJoinResult, error)
- func (s *SwarmService) SwarmLeave(_ context.Context, _ client.SwarmLeaveOptions) (client.SwarmLeaveResult, error)
- func (s *SwarmService) SwarmUnlock(_ context.Context, _ client.SwarmUnlockOptions) (client.SwarmUnlockResult, error)
- func (s *SwarmService) SwarmUpdate(_ context.Context, _ client.SwarmUpdateOptions) (client.SwarmUpdateResult, error)
- type SystemService
- func (s *SystemService) DiskUsage(_ context.Context, _ client.DiskUsageOptions) (client.DiskUsageResult, error)
- func (s *SystemService) Events(_ context.Context, _ client.EventsListOptions) client.EventsResult
- func (s *SystemService) Info(_ context.Context, _ client.InfoOptions) (client.SystemInfoResult, error)
- func (s *SystemService) Ping(_ context.Context, _ client.PingOptions) (client.PingResult, error)
- func (s *SystemService) RegistryLogin(_ context.Context, _ client.RegistryLoginOptions) (client.RegistryLoginResult, error)
- type TaskService
- func (t *TaskService) TaskInspect(_ context.Context, _ string, _ client.TaskInspectOptions) (client.TaskInspectResult, error)
- func (t *TaskService) TaskList(_ context.Context, _ client.TaskListOptions) (client.TaskListResult, error)
- func (t *TaskService) TaskLogs(_ context.Context, _ string, _ client.TaskLogsOptions) (client.TaskLogsResult, error)
- type VolumeService
- func (v *VolumeService) VolumeCreate(_ context.Context, options client.VolumeCreateOptions) (client.VolumeCreateResult, error)
- func (v *VolumeService) VolumeInspect(_ context.Context, volumeID string, _ client.VolumeInspectOptions) (client.VolumeInspectResult, error)
- func (v *VolumeService) VolumeList(_ context.Context, _ client.VolumeListOptions) (client.VolumeListResult, error)
- func (v *VolumeService) VolumePrune(_ context.Context, _ client.VolumePruneOptions) (client.VolumePruneResult, error)
- func (v *VolumeService) VolumeRemove(_ context.Context, volumeID string, _ client.VolumeRemoveOptions) (client.VolumeRemoveResult, error)
- func (v *VolumeService) VolumeUpdate(_ context.Context, _ string, _ client.VolumeUpdateOptions) (client.VolumeUpdateResult, error)
Constants ¶
const Version = "v1.52"
Version represents the supported Docker API version for the mock.
The Docker API version is pinned to ensure compatibility between the Docker API and client. The goal is to maintain n-1 compatibility.
The maximum supported Docker API version for the client is here:
https://docs.docker.com/engine/api/#api-version-matrix
For example (use the compatibility matrix above for reference):
* the Docker version of v29.2 has a maximum API version of v1.53 * to maintain n-1, the API version is pinned to v1.52 .
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() (*mock, error)
New returns a client that is capable of handling Docker client calls and returning stub responses.
func NewStdWriter ¶ added in v0.28.0
NewStdWriter instantiates a new writer using a custom format to multiplex multiple streams to a single writer. All messages written using this writer are encapsulated using a custom format, and written to the underlying stream "w".
Writers created through NewStdWriter allow for multiple write streams (e.g., stdout ([Stdout]) and stderr ([Stderr]) to be multiplexed into a single connection. "streamType" indicates the type of stream to encapsulate, commonly, [Stdout] or [Stderr]. The [Systemerr] stream can be used to include server-side errors in the stream. Information on this stream is returned as an error by [StdCopy] and terminates processing the stream.
The [Stdin] stream is present for completeness and should generally NOT be used. It is output on [Stdout] when reading the stream with [StdCopy].
All streams must share the same underlying io.Writer to ensure proper multiplexing. Each call to NewStdWriter wraps that shared writer with a header indicating the target stream.
Types ¶
type CheckpointService ¶ added in v0.28.0
type CheckpointService struct{}
CheckpointService implements all the checkpoint related functions for the Docker mock.
func (*CheckpointService) CheckpointCreate ¶ added in v0.28.0
func (cp *CheckpointService) CheckpointCreate(_ context.Context, _ string, _ client.CheckpointCreateOptions) (client.CheckpointCreateResult, error)
func (*CheckpointService) CheckpointList ¶ added in v0.28.0
func (cp *CheckpointService) CheckpointList(_ context.Context, _ string, _ client.CheckpointListOptions) (client.CheckpointListResult, error)
func (*CheckpointService) CheckpointRemove ¶ added in v0.28.0
func (cp *CheckpointService) CheckpointRemove(_ context.Context, _ string, _ client.CheckpointRemoveOptions) (client.CheckpointRemoveResult, error)
type ConfigService ¶
type ConfigService struct{}
ConfigService implements all the config related functions for the Docker mock.
func (*ConfigService) ConfigCreate ¶
func (c *ConfigService) ConfigCreate(_ context.Context, _ client.ConfigCreateOptions) (client.ConfigCreateResult, error)
ConfigCreate is a helper function to simulate a mocked call to create a config for a Docker swarm cluster.
func (*ConfigService) ConfigInspect ¶ added in v0.28.0
func (c *ConfigService) ConfigInspect(_ context.Context, _ string, _ client.ConfigInspectOptions) (client.ConfigInspectResult, error)
ConfigInspectWithRaw is a helper function to simulate a mocked call to inspect a config for a Docker swarm cluster and return the raw body received from the API.
func (*ConfigService) ConfigList ¶
func (c *ConfigService) ConfigList(_ context.Context, _ client.ConfigListOptions) (client.ConfigListResult, error)
ConfigList is a helper function to simulate a mocked call to list the configs for a Docker swarm cluster.
func (*ConfigService) ConfigRemove ¶
func (c *ConfigService) ConfigRemove(_ context.Context, _ string, _ client.ConfigRemoveOptions) (client.ConfigRemoveResult, error)
ConfigRemove is a helper function to simulate a mocked call to remove a config for a Docker swarm cluster.
func (*ConfigService) ConfigUpdate ¶
func (c *ConfigService) ConfigUpdate(_ context.Context, _ string, _ client.ConfigUpdateOptions) (client.ConfigUpdateResult, error)
ConfigUpdate is a helper function to simulate a mocked call to update a config for a Docker swarm cluster.
type ContainerService ¶
type ContainerService struct{}
ContainerService implements all the container related functions for the Docker mock.
func (*ContainerService) ContainerAttach ¶
func (c *ContainerService) ContainerAttach(_ context.Context, _ string, _ client.ContainerAttachOptions) (client.ContainerAttachResult, error)
ContainerAttach is a helper function to simulate a mocked call to attach a connection to a Docker container.
func (*ContainerService) ContainerCommit ¶
func (c *ContainerService) ContainerCommit(_ context.Context, _ string, _ client.ContainerCommitOptions) (client.ContainerCommitResult, error)
ContainerCommit is a helper function to simulate a mocked call to apply changes to a Docker container.
func (*ContainerService) ContainerCreate ¶
func (c *ContainerService) ContainerCreate(_ context.Context, opts client.ContainerCreateOptions) (client.ContainerCreateResult, error)
ContainerCreate is a helper function to simulate a mocked call to create a Docker container.
func (*ContainerService) ContainerDiff ¶
func (c *ContainerService) ContainerDiff(_ context.Context, _ string, _ client.ContainerDiffOptions) (client.ContainerDiffResult, error)
ContainerDiff is a helper function to simulate a mocked call to show the differences in the filesystem between two Docker containers.
func (*ContainerService) ContainerExport ¶
func (c *ContainerService) ContainerExport(_ context.Context, _ string, _ client.ContainerExportOptions) (client.ContainerExportResult, error)
ContainerExport is a helper function to simulate a mocked call to expore the contents of a Docker container.
func (*ContainerService) ContainerInspect ¶
func (c *ContainerService) ContainerInspect(_ context.Context, ctn string, _ client.ContainerInspectOptions) (client.ContainerInspectResult, error)
ContainerInspect is a helper function to simulate a mocked call to inspect a Docker container.
func (*ContainerService) ContainerKill ¶
func (c *ContainerService) ContainerKill(_ context.Context, ctn string, _ client.ContainerKillOptions) (client.ContainerKillResult, error)
ContainerKill is a helper function to simulate a mocked call to kill a Docker container.
func (*ContainerService) ContainerList ¶
func (c *ContainerService) ContainerList(_ context.Context, _ client.ContainerListOptions) (client.ContainerListResult, error)
ContainerList is a helper function to simulate a mocked call to list Docker containers.
func (*ContainerService) ContainerLogs ¶
func (c *ContainerService) ContainerLogs(_ context.Context, ctn string, _ client.ContainerLogsOptions) (client.ContainerLogsResult, error)
ContainerLogs is a helper function to simulate a mocked call to capture the logs from a Docker container.
func (*ContainerService) ContainerPause ¶
func (c *ContainerService) ContainerPause(_ context.Context, _ string, _ client.ContainerPauseOptions) (client.ContainerPauseResult, error)
ContainerPause is a helper function to simulate a mocked call to pause a running Docker container.
func (*ContainerService) ContainerPrune ¶ added in v0.28.0
func (c *ContainerService) ContainerPrune(_ context.Context, _ client.ContainerPruneOptions) (client.ContainerPruneResult, error)
ContainersPrune is a helper function to simulate a mocked call to prune Docker containers.
func (*ContainerService) ContainerRemove ¶
func (c *ContainerService) ContainerRemove(_ context.Context, ctn string, _ client.ContainerRemoveOptions) (client.ContainerRemoveResult, error)
ContainerRemove is a helper function to simulate a mocked call to remove a Docker container.
func (*ContainerService) ContainerRename ¶
func (c *ContainerService) ContainerRename(_ context.Context, _ string, _ client.ContainerRenameOptions) (client.ContainerRenameResult, error)
ContainerRename is a helper function to simulate a mocked call to rename a Docker container.
func (*ContainerService) ContainerResize ¶
func (c *ContainerService) ContainerResize(_ context.Context, _ string, _ client.ContainerResizeOptions) (client.ContainerResizeResult, error)
ContainerResize is a helper function to simulate a mocked call to resize a Docker container.
func (*ContainerService) ContainerRestart ¶
func (c *ContainerService) ContainerRestart(_ context.Context, _ string, _ client.ContainerRestartOptions) (client.ContainerRestartResult, error)
ContainerRestart is a helper function to simulate a mocked call to restart a Docker container.
func (*ContainerService) ContainerStart ¶
func (c *ContainerService) ContainerStart(_ context.Context, ctn string, _ client.ContainerStartOptions) (client.ContainerStartResult, error)
ContainerStart is a helper function to simulate a mocked call to start a Docker container.
func (*ContainerService) ContainerStatPath ¶
func (c *ContainerService) ContainerStatPath(_ context.Context, _ string, _ client.ContainerStatPathOptions) (client.ContainerStatPathResult, error)
ContainerStatPath is a helper function to simulate a mocked call to capture information about a path inside a Docker container.
func (*ContainerService) ContainerStats ¶
func (c *ContainerService) ContainerStats(_ context.Context, _ string, _ client.ContainerStatsOptions) (client.ContainerStatsResult, error)
ContainerStats is a helper function to simulate a mocked call to capture information about a Docker container.
func (*ContainerService) ContainerStop ¶
func (c *ContainerService) ContainerStop(_ context.Context, ctn string, _ client.ContainerStopOptions) (client.ContainerStopResult, error)
ContainerStop is a helper function to simulate a mocked call to stop a Docker container.
func (*ContainerService) ContainerTop ¶
func (c *ContainerService) ContainerTop(_ context.Context, _ string, _ client.ContainerTopOptions) (client.ContainerTopResult, error)
ContainerTop is a helper function to simulate a mocked call to show running processes inside a Docker container.
func (*ContainerService) ContainerUnpause ¶
func (c *ContainerService) ContainerUnpause(_ context.Context, _ string, _ client.ContainerUnpauseOptions) (client.ContainerUnpauseResult, error)
ContainerUnpause is a helper function to simulate a mocked call to unpause a Docker container.
func (*ContainerService) ContainerUpdate ¶
func (c *ContainerService) ContainerUpdate(_ context.Context, _ string, _ client.ContainerUpdateOptions) (client.ContainerUpdateResult, error)
ContainerUpdate is a helper function to simulate a mocked call to update a Docker container.
func (*ContainerService) ContainerWait ¶
func (c *ContainerService) ContainerWait(_ context.Context, ctn string, _ client.ContainerWaitOptions) client.ContainerWaitResult
ContainerWait is a helper function to simulate a mocked call to wait for a running Docker container to finish.
func (*ContainerService) CopyFromContainer ¶
func (c *ContainerService) CopyFromContainer(_ context.Context, _ string, opts client.CopyFromContainerOptions) (client.CopyFromContainerResult, error)
CopyFromContainer is a helper function to simulate a mocked call to copy content from a Docker container.
func (*ContainerService) CopyToContainer ¶
func (c *ContainerService) CopyToContainer(_ context.Context, _ string, _ client.CopyToContainerOptions) (client.CopyToContainerResult, error)
CopyToContainer is a helper function to simulate a mocked call to copy content to a Docker container.
type DistributionService ¶
type DistributionService struct{}
DistributionService implements all the distribution related functions for the Docker mock.
func (*DistributionService) DistributionInspect ¶
func (d *DistributionService) DistributionInspect(_ context.Context, _ string, _ client.DistributionInspectOptions) (client.DistributionInspectResult, error)
DistributionInspect is a helper function to simulate a mocked call to inspect a Docker image and return the digest and manifest.
type ExecService ¶ added in v0.28.0
type ExecService struct{}
ExecService implements all the exec related functions for the Docker mock.
func (*ExecService) ExecAttach ¶ added in v0.28.0
func (e *ExecService) ExecAttach(_ context.Context, execID string, _ client.ExecAttachOptions) (client.ExecAttachResult, error)
ExecAttach is a helper function to simulate a mocked call to attach to a Docker exec instance.
func (*ExecService) ExecCreate ¶ added in v0.28.0
func (e *ExecService) ExecCreate(_ context.Context, ctnID string, opts client.ExecCreateOptions) (client.ExecCreateResult, error)
ExecCreate is a helper function to simulate a mocked call to create a Docker exec instance.
func (*ExecService) ExecInspect ¶ added in v0.28.0
func (e *ExecService) ExecInspect(_ context.Context, _ string, _ client.ExecInspectOptions) (client.ExecInspectResult, error)
ExecInspect is a helper function to simulate a mocked call to inspect a Docker exec instance.
func (*ExecService) ExecResize ¶ added in v0.28.0
func (e *ExecService) ExecResize(_ context.Context, _ string, _ client.ExecResizeOptions) (client.ExecResizeResult, error)
ExecResize is a helper function to simulate a mocked call to resize a Docker exec instance.
func (*ExecService) ExecStart ¶ added in v0.28.0
func (e *ExecService) ExecStart(_ context.Context, _ string, _ client.ExecStartOptions) (client.ExecStartResult, error)
ExecStart is a helper function to simulate a mocked call to start a Docker exec instance.
type ImageBuildService ¶ added in v0.28.0
type ImageBuildService struct{}
ImageBuildService implements all the image build related functions for the Docker mock.
func (*ImageBuildService) BuildCachePrune ¶ added in v0.28.0
func (ib *ImageBuildService) BuildCachePrune(_ context.Context, _ client.BuildCachePruneOptions) (client.BuildCachePruneResult, error)
ExecInspect is a helper function to simulate a mocked call to inspect a Docker exec instance.
func (*ImageBuildService) BuildCancel ¶ added in v0.28.0
func (ib *ImageBuildService) BuildCancel(_ context.Context, _ string, _ client.BuildCancelOptions) (client.BuildCancelResult, error)
ExecResize is a helper function to simulate a mocked call to resize a Docker exec instance.
func (*ImageBuildService) ImageBuild ¶ added in v0.28.0
func (ib *ImageBuildService) ImageBuild(_ context.Context, _ io.Reader, _ client.ImageBuildOptions) (client.ImageBuildResult, error)
ExecCreate is a helper function to simulate a mocked call to create a Docker exec instance.
type ImageService ¶
type ImageService struct{}
ImageService implements all the image related functions for the Docker mock.
func (*ImageService) ImageHistory ¶
func (i *ImageService) ImageHistory(_ context.Context, _ string, _ ...client.ImageHistoryOption) (client.ImageHistoryResult, error)
ImageHistory is a helper function to simulate a mocked call to inspect the history for a Docker image.
func (*ImageService) ImageImport ¶
func (i *ImageService) ImageImport(_ context.Context, _ client.ImageImportSource, _ string, _ client.ImageImportOptions) (client.ImageImportResult, error)
ImageImport is a helper function to simulate a mocked call to import a Docker image.
func (*ImageService) ImageInspect ¶ added in v0.27.0
func (i *ImageService) ImageInspect(_ context.Context, img string, _ ...client.ImageInspectOption) (client.ImageInspectResult, error)
ImageInspectWithRaw is a helper function to simulate a mocked call to inspect a Docker image and return the raw body received from the API.
func (*ImageService) ImageList ¶
func (i *ImageService) ImageList(_ context.Context, _ client.ImageListOptions) (client.ImageListResult, error)
ImageList is a helper function to simulate a mocked call to list Docker images.
func (*ImageService) ImageLoad ¶
func (i *ImageService) ImageLoad(_ context.Context, _ io.Reader, _ ...client.ImageLoadOption) (client.ImageLoadResult, error)
ImageLoad is a helper function to simulate a mocked call to load a Docker image.
func (*ImageService) ImagePrune ¶ added in v0.28.0
func (i *ImageService) ImagePrune(_ context.Context, _ client.ImagePruneOptions) (client.ImagePruneResult, error)
ImagesPrune is a helper function to simulate a mocked call to prune Docker images.
func (*ImageService) ImagePull ¶
func (i *ImageService) ImagePull(_ context.Context, image string, _ client.ImagePullOptions) (client.ImagePullResponse, error)
ImagePull is a helper function to simulate a mocked call to pull a Docker image.
func (*ImageService) ImagePush ¶
func (i *ImageService) ImagePush(_ context.Context, _ string, _ client.ImagePushOptions) (client.ImagePushResponse, error)
ImagePush is a helper function to simulate a mocked call to push a Docker image.
func (*ImageService) ImageRemove ¶
func (i *ImageService) ImageRemove(_ context.Context, _ string, _ client.ImageRemoveOptions) (client.ImageRemoveResult, error)
ImageRemove is a helper function to simulate a mocked call to remove a Docker image.
func (*ImageService) ImageSave ¶
func (i *ImageService) ImageSave(_ context.Context, _ []string, _ ...client.ImageSaveOption) (client.ImageSaveResult, error)
ImageSave is a helper function to simulate a mocked call to save a Docker image.
func (*ImageService) ImageTag ¶
func (i *ImageService) ImageTag(_ context.Context, _ client.ImageTagOptions) (client.ImageTagResult, error)
ImageTag is a helper function to simulate a mocked call to tag a Docker image.
type NetworkService ¶
type NetworkService struct{}
NetworkService implements all the network related functions for the Docker mock.
func (*NetworkService) NetworkConnect ¶
func (n *NetworkService) NetworkConnect(_ context.Context, _ string, _ client.NetworkConnectOptions) (client.NetworkConnectResult, error)
NetworkConnect is a helper function to simulate a mocked call to connect to a Docker network.
func (*NetworkService) NetworkCreate ¶
func (n *NetworkService) NetworkCreate(_ context.Context, name string, _ client.NetworkCreateOptions) (client.NetworkCreateResult, error)
NetworkCreate is a helper function to simulate a mocked call to create a Docker network.
func (*NetworkService) NetworkDisconnect ¶
func (n *NetworkService) NetworkDisconnect(_ context.Context, _ string, _ client.NetworkDisconnectOptions) (client.NetworkDisconnectResult, error)
NetworkDisconnect is a helper function to simulate a mocked call to disconnect from a Docker network.
func (*NetworkService) NetworkInspect ¶
func (n *NetworkService) NetworkInspect(_ context.Context, networkID string, _ client.NetworkInspectOptions) (client.NetworkInspectResult, error)
NetworkInspect is a helper function to simulate a mocked call to inspect a Docker network.
func (*NetworkService) NetworkList ¶
func (n *NetworkService) NetworkList(_ context.Context, _ client.NetworkListOptions) (client.NetworkListResult, error)
NetworkList is a helper function to simulate a mocked call to list Docker networks.
func (*NetworkService) NetworkPrune ¶ added in v0.28.0
func (n *NetworkService) NetworkPrune(_ context.Context, _ client.NetworkPruneOptions) (client.NetworkPruneResult, error)
NetworksPrune is a helper function to simulate a mocked call to prune Docker networks.
func (*NetworkService) NetworkRemove ¶
func (n *NetworkService) NetworkRemove(_ context.Context, network string, _ client.NetworkRemoveOptions) (client.NetworkRemoveResult, error)
NetworkRemove is a helper function to simulate a mocked call to remove Docker a network.
type NodeService ¶
type NodeService struct{}
NodeService implements all the node related functions for the Docker mock.
func (*NodeService) NodeInspect ¶ added in v0.28.0
func (n *NodeService) NodeInspect(_ context.Context, _ string, _ client.NodeInspectOptions) (client.NodeInspectResult, error)
NodeInspectWithRaw is a helper function to simulate a mocked call to inspect a node for a Docker swarm cluster and return the raw body received from the API.
func (*NodeService) NodeList ¶
func (n *NodeService) NodeList(_ context.Context, _ client.NodeListOptions) (client.NodeListResult, error)
NodeList is a helper function to simulate a mocked call to list the nodes for a Docker swarm cluster.
func (*NodeService) NodeRemove ¶
func (n *NodeService) NodeRemove(_ context.Context, _ string, _ client.NodeRemoveOptions) (client.NodeRemoveResult, error)
NodeRemove is a helper function to simulate a mocked call to remove a node from a Docker swarm cluster.
func (*NodeService) NodeUpdate ¶
func (n *NodeService) NodeUpdate(_ context.Context, _ string, _ client.NodeUpdateOptions) (client.NodeUpdateResult, error)
NodeUpdate is a helper function to simulate a mocked call to update a node for a Docker swarm cluster.
type PluginService ¶
type PluginService struct{}
PluginService implements all the plugin related functions for the Docker mock.
func (*PluginService) PluginCreate ¶
func (p *PluginService) PluginCreate(_ context.Context, _ io.Reader, _ client.PluginCreateOptions) (client.PluginCreateResult, error)
PluginCreate is a helper function to simulate a mocked call to create a Docker plugin.
func (*PluginService) PluginDisable ¶
func (p *PluginService) PluginDisable(_ context.Context, _ string, _ client.PluginDisableOptions) (client.PluginDisableResult, error)
PluginDisable is a helper function to simulate a mocked call to disable a Docker plugin.
func (*PluginService) PluginEnable ¶
func (p *PluginService) PluginEnable(_ context.Context, _ string, _ client.PluginEnableOptions) (client.PluginEnableResult, error)
PluginEnable is a helper function to simulate a mocked call to enable a Docker plugin.
func (*PluginService) PluginInspect ¶ added in v0.28.0
func (p *PluginService) PluginInspect(_ context.Context, _ string, _ client.PluginInspectOptions) (client.PluginInspectResult, error)
PluginInspectWithRaw is a helper function to simulate a mocked call to inspect a Docker plugin and return the raw body received from the API.
func (*PluginService) PluginInstall ¶
func (p *PluginService) PluginInstall(_ context.Context, _ string, _ client.PluginInstallOptions) (client.PluginInstallResult, error)
PluginInstall is a helper function to simulate a mocked call to install a Docker plugin.
func (*PluginService) PluginList ¶
func (p *PluginService) PluginList(_ context.Context, _ client.PluginListOptions) (client.PluginListResult, error)
PluginList is a helper function to simulate a mocked call to list Docker plugins.
func (*PluginService) PluginPush ¶
func (p *PluginService) PluginPush(_ context.Context, _ string, _ client.PluginPushOptions) (client.PluginPushResult, error)
PluginPush is a helper function to simulate a mocked call to push a Docker plugin.
func (*PluginService) PluginRemove ¶
func (p *PluginService) PluginRemove(_ context.Context, _ string, _ client.PluginRemoveOptions) (client.PluginRemoveResult, error)
PluginRemove is a helper function to simulate a mocked call to remove a Docker plugin.
func (*PluginService) PluginSet ¶
func (p *PluginService) PluginSet(_ context.Context, _ string, _ client.PluginSetOptions) (client.PluginSetResult, error)
PluginSet is a helper function to simulate a mocked call to update settings for a Docker plugin.
func (*PluginService) PluginUpgrade ¶
func (p *PluginService) PluginUpgrade(_ context.Context, _ string, _ client.PluginUpgradeOptions) (client.PluginUpgradeResult, error)
PluginUpgrade is a helper function to simulate a mocked call to upgrade a Docker plugin.
type RegistryService ¶ added in v0.28.0
type RegistryService struct{}
RegistryService implements all the registry related functions for the Docker mock.
func (*RegistryService) ImageSearch ¶ added in v0.28.0
func (r *RegistryService) ImageSearch(_ context.Context, _ string, _ client.ImageSearchOptions) (client.ImageSearchResult, error)
ImageSearch is a helper function to simulate a mocked call to search for a Docker image.
type SecretService ¶
type SecretService struct{}
SecretService implements all the secret related functions for the Docker mock.
func (*SecretService) SecretCreate ¶
func (s *SecretService) SecretCreate(_ context.Context, _ client.SecretCreateOptions) (client.SecretCreateResult, error)
SecretCreate is a helper function to simulate a mocked call to create a secret for a Docker swarm cluster.
func (*SecretService) SecretInspect ¶ added in v0.28.0
func (s *SecretService) SecretInspect(_ context.Context, _ string, _ client.SecretInspectOptions) (client.SecretInspectResult, error)
SecretInspectWithRaw is a helper function to simulate a mocked call to inspect a Docker secret and return the raw body received from the API.
func (*SecretService) SecretList ¶
func (s *SecretService) SecretList(_ context.Context, _ client.SecretListOptions) (client.SecretListResult, error)
SecretList is a helper function to simulate a mocked call to list secrets for a Docker swarm cluster.
func (*SecretService) SecretRemove ¶
func (s *SecretService) SecretRemove(_ context.Context, _ string, _ client.SecretRemoveOptions) (client.SecretRemoveResult, error)
SecretRemove is a helper function to simulate a mocked call to remove a secret for a Docker swarm cluster.
func (*SecretService) SecretUpdate ¶
func (s *SecretService) SecretUpdate(_ context.Context, _ string, _ client.SecretUpdateOptions) (client.SecretUpdateResult, error)
SecretUpdate is a helper function to simulate a mocked call to update a secret for a Docker swarm cluster.
type ServiceService ¶
type ServiceService struct{}
ServiceService implements all the service related functions for the Docker mock.
func (*ServiceService) ServiceCreate ¶
func (s *ServiceService) ServiceCreate(_ context.Context, _ client.ServiceCreateOptions) (client.ServiceCreateResult, error)
ServiceCreate is a helper function to simulate a mocked call to create a service for a Docker swarm cluster.
func (*ServiceService) ServiceInspect ¶ added in v0.28.0
func (s *ServiceService) ServiceInspect(_ context.Context, _ string, _ client.ServiceInspectOptions) (client.ServiceInspectResult, error)
ServiceInspectWithRaw is a helper function to simulate a mocked call to inspect a Docker service and return the raw body received from the API.
func (*ServiceService) ServiceList ¶
func (s *ServiceService) ServiceList(_ context.Context, _ client.ServiceListOptions) (client.ServiceListResult, error)
ServiceList is a helper function to simulate a mocked call to list services for a Docker swarm cluster.
func (*ServiceService) ServiceLogs ¶
func (s *ServiceService) ServiceLogs(_ context.Context, _ string, _ client.ServiceLogsOptions) (client.ServiceLogsResult, error)
ServiceLogs is a helper function to simulate a mocked call to capture the logs from a service for a Docker swarm cluster.
func (*ServiceService) ServiceRemove ¶
func (s *ServiceService) ServiceRemove(_ context.Context, _ string, _ client.ServiceRemoveOptions) (client.ServiceRemoveResult, error)
ServiceRemove is a helper function to simulate a mocked call to remove a service for a Docker swarm cluster.
func (*ServiceService) ServiceUpdate ¶
func (s *ServiceService) ServiceUpdate(_ context.Context, _ string, _ client.ServiceUpdateOptions) (client.ServiceUpdateResult, error)
ServiceUpdate is a helper function to simulate a mocked call to update a service for a Docker swarm cluster.
type SwarmService ¶
type SwarmService struct{}
SwarmService implements all the swarm related functions for the Docker mock.
func (*SwarmService) SwarmGetUnlockKey ¶
func (s *SwarmService) SwarmGetUnlockKey(_ context.Context) (client.SwarmGetUnlockKeyResult, error)
SwarmGetUnlockKey is a helper function to simulate a mocked call to capture the unlock key for a Docker swarm cluster.
func (*SwarmService) SwarmInit ¶
func (s *SwarmService) SwarmInit(_ context.Context, _ client.SwarmInitOptions) (client.SwarmInitResult, error)
SwarmInit is a helper function to simulate a mocked call to initialize the Docker swarm cluster.
func (*SwarmService) SwarmInspect ¶
func (s *SwarmService) SwarmInspect(_ context.Context, _ client.SwarmInspectOptions) (client.SwarmInspectResult, error)
SwarmInspect is a helper function to simulate a mocked call to inspect the Docker swarm cluster.
func (*SwarmService) SwarmJoin ¶
func (s *SwarmService) SwarmJoin(_ context.Context, _ client.SwarmJoinOptions) (client.SwarmJoinResult, error)
SwarmJoin is a helper function to simulate a mocked call to join the Docker swarm cluster.
func (*SwarmService) SwarmLeave ¶
func (s *SwarmService) SwarmLeave(_ context.Context, _ client.SwarmLeaveOptions) (client.SwarmLeaveResult, error)
SwarmLeave is a helper function to simulate a mocked call to leave the Docker swarm cluster.
func (*SwarmService) SwarmUnlock ¶
func (s *SwarmService) SwarmUnlock(_ context.Context, _ client.SwarmUnlockOptions) (client.SwarmUnlockResult, error)
SwarmUnlock is a helper function to simulate a mocked call to unlock the Docker swarm cluster.
func (*SwarmService) SwarmUpdate ¶
func (s *SwarmService) SwarmUpdate(_ context.Context, _ client.SwarmUpdateOptions) (client.SwarmUpdateResult, error)
SwarmUpdate is a helper function to simulate a mocked call to update the Docker swarm cluster.
type SystemService ¶
type SystemService struct{}
SystemService implements all the system related functions for the Docker mock.
func (*SystemService) DiskUsage ¶
func (s *SystemService) DiskUsage(_ context.Context, _ client.DiskUsageOptions) (client.DiskUsageResult, error)
DiskUsage is a helper function to simulate a mocked call to capture the data usage from the Docker daemon.
func (*SystemService) Events ¶
func (s *SystemService) Events(_ context.Context, _ client.EventsListOptions) client.EventsResult
Events is a helper function to simulate a mocked call to capture the events from the Docker daemon.
func (*SystemService) Info ¶
func (s *SystemService) Info(_ context.Context, _ client.InfoOptions) (client.SystemInfoResult, error)
Info is a helper function to simulate a mocked call to capture the system information from the Docker daemon.
func (*SystemService) Ping ¶
func (s *SystemService) Ping(_ context.Context, _ client.PingOptions) (client.PingResult, error)
Ping is a helper function to simulate a mocked call to ping the Docker daemon and return version information.
func (*SystemService) RegistryLogin ¶
func (s *SystemService) RegistryLogin(_ context.Context, _ client.RegistryLoginOptions) (client.RegistryLoginResult, error)
RegistryLogin is a helper function to simulate a mocked call to authenticate the Docker daemon against a Docker registry.
type TaskService ¶ added in v0.28.0
type TaskService struct{}
TaskService implements all the task related functions for the Docker mock.
func (*TaskService) TaskInspect ¶ added in v0.28.0
func (t *TaskService) TaskInspect(_ context.Context, _ string, _ client.TaskInspectOptions) (client.TaskInspectResult, error)
TaskInspectWithRaw is a helper function to simulate a mocked call to inspect a task for a Docker swarm cluster and return the raw body received from the API.
func (*TaskService) TaskList ¶ added in v0.28.0
func (t *TaskService) TaskList(_ context.Context, _ client.TaskListOptions) (client.TaskListResult, error)
TaskList is a helper function to simulate a mocked call to list tasks for a Docker swarm cluster.
func (*TaskService) TaskLogs ¶ added in v0.28.0
func (t *TaskService) TaskLogs(_ context.Context, _ string, _ client.TaskLogsOptions) (client.TaskLogsResult, error)
TaskLogs is a helper function to simulate a mocked call to capture the logs from a task for a Docker swarm cluster.
type VolumeService ¶
type VolumeService struct{}
VolumeService implements all the volume related functions for the Docker mock.
func (*VolumeService) VolumeCreate ¶
func (v *VolumeService) VolumeCreate(_ context.Context, options client.VolumeCreateOptions) (client.VolumeCreateResult, error)
VolumeCreate is a helper function to simulate a mocked call to create a Docker volume.
func (*VolumeService) VolumeInspect ¶
func (v *VolumeService) VolumeInspect(_ context.Context, volumeID string, _ client.VolumeInspectOptions) (client.VolumeInspectResult, error)
VolumeInspect is a helper function to simulate a mocked call to inspect a Docker volume.
func (*VolumeService) VolumeList ¶
func (v *VolumeService) VolumeList(_ context.Context, _ client.VolumeListOptions) (client.VolumeListResult, error)
VolumeList is a helper function to simulate a mocked call to list Docker volumes.
func (*VolumeService) VolumePrune ¶ added in v0.28.0
func (v *VolumeService) VolumePrune(_ context.Context, _ client.VolumePruneOptions) (client.VolumePruneResult, error)
VolumesPrune is a helper function to simulate a mocked call to prune Docker volumes.
func (*VolumeService) VolumeRemove ¶
func (v *VolumeService) VolumeRemove(_ context.Context, volumeID string, _ client.VolumeRemoveOptions) (client.VolumeRemoveResult, error)
VolumeRemove is a helper function to simulate a mocked call to remove Docker a volume.
func (*VolumeService) VolumeUpdate ¶ added in v0.22.0
func (v *VolumeService) VolumeUpdate(_ context.Context, _ string, _ client.VolumeUpdateOptions) (client.VolumeUpdateResult, error)
VolumeUpdate is a helper function to simulate a mocked call to update Docker volumes.