dockermock

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonAPIClientMock

CommonAPIClientMock is the common methods between stable and experimental versions of APIClient.

func NewCommonAPIClientMock

func NewCommonAPIClientMock() *CommonAPIClientMock

NewCommonAPIClientMock creates docker ContainerAPIClient mock.

func (*CommonAPIClientMock) ClientVersion

func (m *CommonAPIClientMock) ClientVersion() string

ClientVersion returns the API version used by this client.

func (*CommonAPIClientMock) Close

func (m *CommonAPIClientMock) Close() error

Close the transport used by the client.

func (*CommonAPIClientMock) DaemonHost

func (m *CommonAPIClientMock) DaemonHost() string

DaemonHost returns the host address used by the client.

func (*CommonAPIClientMock) DialSession

func (m *CommonAPIClientMock) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error)

DialSession returns a connection that can be used communication with daemon.

func (*CommonAPIClientMock) Dialer

func (m *CommonAPIClientMock) Dialer() func(context.Context) (net.Conn, error)

Dialer returns a dialer for a raw stream connection, with HTTP/1.1 header, that can be used for proxying the daemon connection. Used by `docker dial-stdio`.

func (*CommonAPIClientMock) HTTPClient

func (m *CommonAPIClientMock) HTTPClient() *http.Client

HTTPClient returns a copy of the HTTP client bound to the server.

func (*CommonAPIClientMock) NegotiateAPIVersion

func (m *CommonAPIClientMock) NegotiateAPIVersion(ctx context.Context)

NegotiateAPIVersion queries the API and updates the version to match the API version. Any errors are silently ignored.

func (*CommonAPIClientMock) NegotiateAPIVersionPing

func (m *CommonAPIClientMock) NegotiateAPIVersionPing(ping types.Ping)

NegotiateAPIVersionPing updates the client version to match the Ping.APIVersion if the ping version is less than the default version.

func (*CommonAPIClientMock) ServerVersion

func (m *CommonAPIClientMock) ServerVersion(ctx context.Context) (types.Version, error)

ServerVersion returns information of the docker client and server host.

type ConfigAPIClientMock

type ConfigAPIClientMock struct {
	*mock.Mock
}

ConfigAPIClientMock defines API client methods for configs.

func (*ConfigAPIClientMock) ConfigCreate

ConfigCreate creates a new Config.

func (*ConfigAPIClientMock) ConfigInspectWithRaw

func (m *ConfigAPIClientMock) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error)

ConfigInspectWithRaw returns the config information with raw data.

func (*ConfigAPIClientMock) ConfigList

func (m *ConfigAPIClientMock) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error)

ConfigList returns the list of configs.

func (*ConfigAPIClientMock) ConfigRemove

func (m *ConfigAPIClientMock) ConfigRemove(ctx context.Context, id string) error

ConfigRemove removes a Config.

func (*ConfigAPIClientMock) ConfigUpdate

func (m *ConfigAPIClientMock) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error

ConfigUpdate attempts to update a Config.

type ContainerAPIClientMock

type ContainerAPIClientMock struct {
	*mock.Mock
}

ContainerAPIClientMock defines API client methods for the containers

func (*ContainerAPIClientMock) ContainerAttach

func (m *ContainerAPIClientMock) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error)

ContainerAttach attaches a connection to a container in the server. It returns a types.HijackedConnection with the hijacked connection and the a reader to get output. It's up to the called to close the hijacked connection by calling types.HijackedResponse.Close.

func (*ContainerAPIClientMock) ContainerCommit

func (m *ContainerAPIClientMock) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error)

ContainerCommit applies changes into a container and creates a new tagged image.

func (*ContainerAPIClientMock) ContainerCreate

ContainerCreate creates a new container based in the given configuration. It can be associated with a name, but it's not mandatory.

func (*ContainerAPIClientMock) ContainerDiff

ContainerDiff shows differences in a container filesystem since it was started.

func (*ContainerAPIClientMock) ContainerExecAttach

func (m *ContainerAPIClientMock) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)

ContainerExecAttach attaches a connection to an exec process in the server. It returns a types.HijackedConnection with the hijacked connection and the a reader to get output. It's up to the called to close the hijacked connection by calling types.HijackedResponse.Close.

func (*ContainerAPIClientMock) ContainerExecCreate

func (m *ContainerAPIClientMock) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)

ContainerExecCreate creates a new exec configuration to run an exec process.

func (*ContainerAPIClientMock) ContainerExecInspect

func (m *ContainerAPIClientMock) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)

ContainerExecInspect returns information about a specific exec process on the docker host.

func (*ContainerAPIClientMock) ContainerExecResize

func (m *ContainerAPIClientMock) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error

ContainerExecResize changes the size of the tty for an exec process running inside a container.

func (*ContainerAPIClientMock) ContainerExecStart

func (m *ContainerAPIClientMock) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error

ContainerExecStart starts an exec process already created in the docker host.

func (*ContainerAPIClientMock) ContainerExport

func (m *ContainerAPIClientMock) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)

ContainerExport retrieves the raw contents of a container and returns them as an io.ReadCloser. It's up to the caller to close the stream.

func (*ContainerAPIClientMock) ContainerInspect

func (m *ContainerAPIClientMock) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error)

ContainerInspect returns the container information.

func (*ContainerAPIClientMock) ContainerInspectWithRaw

func (m *ContainerAPIClientMock) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error)

ContainerInspectWithRaw returns the container information and its raw representation.

func (*ContainerAPIClientMock) ContainerKill

func (m *ContainerAPIClientMock) ContainerKill(ctx context.Context, container, signal string) error

ContainerKill terminates the container process but does not remove the container from the docker host.

func (*ContainerAPIClientMock) ContainerList

ContainerList returns the list of containers in the docker host.

func (*ContainerAPIClientMock) ContainerLogs

func (m *ContainerAPIClientMock) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error)

ContainerLogs returns the logs generated by a container in an io.ReadCloser. It's up to the caller to close the stream.

func (*ContainerAPIClientMock) ContainerPause

func (m *ContainerAPIClientMock) ContainerPause(ctx context.Context, container string) error

ContainerPause pauses the main process of a given container without terminating it.

func (*ContainerAPIClientMock) ContainerRemove

func (m *ContainerAPIClientMock) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error

ContainerRemove kills and removes a container from the docker host.

func (*ContainerAPIClientMock) ContainerRename

func (m *ContainerAPIClientMock) ContainerRename(ctx context.Context, container, newContainerName string) error

ContainerRename changes the name of a given container.

func (*ContainerAPIClientMock) ContainerResize

func (m *ContainerAPIClientMock) ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error

ContainerResize changes the size of the tty for a container.

func (*ContainerAPIClientMock) ContainerRestart

func (m *ContainerAPIClientMock) ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error

ContainerRestart stops and starts a container again. It makes the daemon to wait for the container to be up again for a specific amount of time, given the timeout.

func (*ContainerAPIClientMock) ContainerStart

func (m *ContainerAPIClientMock) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error

ContainerStart sends a request to the docker daemon to start a container.

func (*ContainerAPIClientMock) ContainerStatPath

func (m *ContainerAPIClientMock) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error)

ContainerStatPath returns Stat information about a path inside the container filesystem.

func (*ContainerAPIClientMock) ContainerStats

func (m *ContainerAPIClientMock) ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error)

ContainerStats returns near realtime stats for a given container. It's up to the caller to close the io.ReadCloser returned.

func (*ContainerAPIClientMock) ContainerStop

func (m *ContainerAPIClientMock) ContainerStop(ctx context.Context, container string, timeout *time.Duration) error

ContainerStop stops a container without terminating the process. The process is blocked until the container stops or the timeout expires.

func (*ContainerAPIClientMock) ContainerTop

func (m *ContainerAPIClientMock) ContainerTop(ctx context.Context, container string, arguments []string) (containertypes.ContainerTopOKBody, error)

ContainerTop shows process information from within a container.

func (*ContainerAPIClientMock) ContainerUnpause

func (m *ContainerAPIClientMock) ContainerUnpause(ctx context.Context, container string) error

ContainerUnpause resumes the process execution within a container

func (*ContainerAPIClientMock) ContainerUpdate

ContainerUpdate updates resources of a container.

func (*ContainerAPIClientMock) ContainerWait

func (m *ContainerAPIClientMock) ContainerWait(ctx context.Context, container string, condition containertypes.WaitCondition) (<-chan containertypes.ContainerWaitOKBody, <-chan error)

ContainerWait pauses execution until a container exits. It returns the API status code as response of its readiness.

func (*ContainerAPIClientMock) ContainersPrune

func (m *ContainerAPIClientMock) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error)

ContainersPrune requests the daemon to delete unused data.

func (*ContainerAPIClientMock) CopyFromContainer

func (m *ContainerAPIClientMock) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)

CopyFromContainer gets the content from the container and returns it as a Reader to manipulate it in the host. It's up to the caller to close the reader.

func (*ContainerAPIClientMock) CopyToContainer

func (m *ContainerAPIClientMock) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error

CopyToContainer copies content into the container filesystem.

type DistributionAPIClientMock

type DistributionAPIClientMock struct {
	*mock.Mock
}

DistributionAPIClientMock defines API client methods for the registry.

func (*DistributionAPIClientMock) DistributionInspect

func (m *DistributionAPIClientMock) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registry.DistributionInspect, error)

DistributionInspect returns the image digest with full Manifest.

type ImageAPIClientMock

type ImageAPIClientMock struct {
	*mock.Mock
}

ImageAPIClientMock defines API client methods for the images.

func (*ImageAPIClientMock) BuildCachePrune

func (m *ImageAPIClientMock) BuildCachePrune(ctx context.Context) (*types.BuildCachePruneReport, error)

BuildCachePrune requests the daemon to delete unused cache data.

func (*ImageAPIClientMock) BuildCancel

func (m *ImageAPIClientMock) BuildCancel(ctx context.Context, id string) error

BuildCancel requests the daemon to cancel ongoing build request.

func (*ImageAPIClientMock) ImageBuild

ImageBuild sends request to the daemon to build images. The Body in the response implement an io.ReadCloser and it's up to the caller to close it.

func (*ImageAPIClientMock) ImageCreate

func (m *ImageAPIClientMock) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error)

ImageCreate creates a new image based in the parent options. It returns the JSON content in the response body.

func (*ImageAPIClientMock) ImageHistory

func (m *ImageAPIClientMock) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error)

ImageHistory returns the changes in an image in history format.

func (*ImageAPIClientMock) ImageImport

ImageImport creates a new image based in the source options. It returns the JSON content in the response body.

func (*ImageAPIClientMock) ImageInspectWithRaw

func (m *ImageAPIClientMock) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)

ImageInspectWithRaw returns the image information and its raw representation.

func (*ImageAPIClientMock) ImageList

ImageList returns a list of images in the docker host.

func (*ImageAPIClientMock) ImageLoad

func (m *ImageAPIClientMock) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error)

ImageLoad loads an image in the docker host from the client host. It's up to the caller to close the io.ReadCloser in the ImageLoadResponse returned by this function.

func (*ImageAPIClientMock) ImagePull

func (m *ImageAPIClientMock) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)

ImagePull requests the docker host to pull an image from a remote registry. It executes the privileged function if the operation is unauthorized and it tries one more time. It's up to the caller to handle the io.ReadCloser and close it properly.

func (*ImageAPIClientMock) ImagePush

func (m *ImageAPIClientMock) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)

ImagePush requests the docker host to push an image to a remote registry. It executes the privileged function if the operation is unauthorized and it tries one more time. It's up to the caller to handle the io.ReadCloser and close it properly.

func (*ImageAPIClientMock) ImageRemove

ImageRemove removes an image from the docker host.

func (*ImageAPIClientMock) ImageSave

func (m *ImageAPIClientMock) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)

ImageSave retrieves one or more images from the docker host as an io.ReadCloser. It's up to the caller to store the images and close the stream.

func (*ImageAPIClientMock) ImageSearch

ImageSearch makes the docker host to search by a term in a remote registry. The list of results is not sorted in any fashion.

func (*ImageAPIClientMock) ImageTag

func (m *ImageAPIClientMock) ImageTag(ctx context.Context, image, ref string) error

ImageTag tags an image in the docker host.

func (*ImageAPIClientMock) ImagesPrune

func (m *ImageAPIClientMock) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (types.ImagesPruneReport, error)

ImagesPrune requests the daemon to delete unused data

type NetworkAPIClientMock

type NetworkAPIClientMock struct {
	*mock.Mock
}

NetworkAPIClientMock defines API client methods for the networks

func (*NetworkAPIClientMock) NetworkConnect

func (m *NetworkAPIClientMock) NetworkConnect(ctx context.Context, network, container string, config *networktypes.EndpointSettings) error

NetworkConnect connects a container to an existent network in the docker host.

func (*NetworkAPIClientMock) NetworkCreate

NetworkCreate creates a new network in the docker host.

func (*NetworkAPIClientMock) NetworkDisconnect

func (m *NetworkAPIClientMock) NetworkDisconnect(ctx context.Context, network, container string, force bool) error

NetworkDisconnect disconnects a container from an existent network in the docker host.

func (*NetworkAPIClientMock) NetworkInspect

func (m *NetworkAPIClientMock) NetworkInspect(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, error)

NetworkInspect returns the information for a specific network configured in the docker host.

func (*NetworkAPIClientMock) NetworkInspectWithRaw

func (m *NetworkAPIClientMock) NetworkInspectWithRaw(ctx context.Context, network string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error)

NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation.

func (*NetworkAPIClientMock) NetworkList

NetworkList returns the list of networks configured in the docker host.

func (*NetworkAPIClientMock) NetworkRemove

func (m *NetworkAPIClientMock) NetworkRemove(ctx context.Context, network string) error

NetworkRemove removes an existent network from the docker host.

func (*NetworkAPIClientMock) NetworksPrune

func (m *NetworkAPIClientMock) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (types.NetworksPruneReport, error)

NetworksPrune requests the daemon to delete unused networks.

type NodeAPIClientMock

type NodeAPIClientMock struct {
	*mock.Mock
}

NodeAPIClientMock defines API client methods for the nodes.

func (*NodeAPIClientMock) NodeInspectWithRaw

func (m *NodeAPIClientMock) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error)

NodeInspectWithRaw returns the node information.

func (*NodeAPIClientMock) NodeList

func (m *NodeAPIClientMock) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error)

NodeList returns the list of nodes.

func (*NodeAPIClientMock) NodeRemove

func (m *NodeAPIClientMock) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error

NodeRemove removes a Node.

func (*NodeAPIClientMock) NodeUpdate

func (m *NodeAPIClientMock) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error

NodeUpdate updates a Node.

type PluginAPIClientMock

type PluginAPIClientMock struct {
	*mock.Mock
}

PluginAPIClientMock defines API client methods for the plugins.

func (*PluginAPIClientMock) PluginCreate

func (m *PluginAPIClientMock) PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error

PluginCreate creates a plugin.

func (*PluginAPIClientMock) PluginDisable

func (m *PluginAPIClientMock) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error

PluginDisable disables a plugin.

func (*PluginAPIClientMock) PluginEnable

func (m *PluginAPIClientMock) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error

PluginEnable enables a plugin.

func (*PluginAPIClientMock) PluginInspectWithRaw

func (m *PluginAPIClientMock) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error)

PluginInspectWithRaw inspects an existing plugin.

func (*PluginAPIClientMock) PluginInstall

func (m *PluginAPIClientMock) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)

PluginInstall installs a plugin.

func (*PluginAPIClientMock) PluginList

PluginList returns the installed plugins.

func (*PluginAPIClientMock) PluginPush

func (m *PluginAPIClientMock) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)

PluginPush pushes a plugin to a registry.

func (*PluginAPIClientMock) PluginRemove

func (m *PluginAPIClientMock) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error

PluginRemove removes a plugin.

func (*PluginAPIClientMock) PluginSet

func (m *PluginAPIClientMock) PluginSet(ctx context.Context, name string, args []string) error

PluginSet modifies settings for an existing plugin.

func (*PluginAPIClientMock) PluginUpgrade

func (m *PluginAPIClientMock) PluginUpgrade(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error)

PluginUpgrade upgrades a plugin.

type SecretAPIClientMock

type SecretAPIClientMock struct {
	*mock.Mock
}

SecretAPIClientMock defines API client methods for secrets.

func (*SecretAPIClientMock) SecretCreate

SecretCreate creates a new Secret.

func (*SecretAPIClientMock) SecretInspectWithRaw

func (m *SecretAPIClientMock) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error)

SecretInspectWithRaw returns the secret information with raw data.

func (*SecretAPIClientMock) SecretList

func (m *SecretAPIClientMock) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error)

SecretList returns the list of secrets.

func (*SecretAPIClientMock) SecretRemove

func (m *SecretAPIClientMock) SecretRemove(ctx context.Context, id string) error

SecretRemove removes a Secret.

func (*SecretAPIClientMock) SecretUpdate

func (m *SecretAPIClientMock) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error

SecretUpdate updates a Secret. Currently, the only part of a secret spec which can be updated is Labels.

type ServiceAPIClientMock

type ServiceAPIClientMock struct {
	*mock.Mock
}

ServiceAPIClientMock defines API client methods for the services.

func (*ServiceAPIClientMock) ServiceCreate

ServiceCreate creates a new Service.

func (*ServiceAPIClientMock) ServiceInspectWithRaw

func (m *ServiceAPIClientMock) ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error)

ServiceInspectWithRaw returns the service information and the raw data.

func (*ServiceAPIClientMock) ServiceList

func (m *ServiceAPIClientMock) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error)

ServiceList returns the list of services.

func (*ServiceAPIClientMock) ServiceLogs

func (m *ServiceAPIClientMock) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error)

ServiceLogs returns the logs generated by a service in an io.ReadCloser. It's up to the caller to close the stream.

func (*ServiceAPIClientMock) ServiceRemove

func (m *ServiceAPIClientMock) ServiceRemove(ctx context.Context, serviceID string) error

ServiceRemove kills and removes a service.

func (*ServiceAPIClientMock) ServiceUpdate

func (m *ServiceAPIClientMock) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error)

ServiceUpdate updates a Service.

func (*ServiceAPIClientMock) TaskInspectWithRaw

func (m *ServiceAPIClientMock) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error)

TaskInspectWithRaw returns the task information and its raw representation..

func (*ServiceAPIClientMock) TaskList

func (m *ServiceAPIClientMock) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error)

TaskList returns the list of tasks.

func (*ServiceAPIClientMock) TaskLogs

TaskLogs returns the logs generated by a task in an io.ReadCloser. It's up to the caller to close the stream.

type SwarmAPIClientMock

type SwarmAPIClientMock struct {
	*mock.Mock
}

SwarmAPIClientMock defines API client methods for the swarm.

func (*SwarmAPIClientMock) SwarmGetUnlockKey

func (m *SwarmAPIClientMock) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error)

SwarmGetUnlockKey retrieves the swarm's unlock key.

func (*SwarmAPIClientMock) SwarmInit

func (m *SwarmAPIClientMock) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)

SwarmInit initializes the Swarm.

func (*SwarmAPIClientMock) SwarmInspect

func (m *SwarmAPIClientMock) SwarmInspect(ctx context.Context) (swarm.Swarm, error)

SwarmInspect inspects the Swarm.

func (*SwarmAPIClientMock) SwarmJoin

func (m *SwarmAPIClientMock) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error

SwarmJoin joins the Swarm.

func (*SwarmAPIClientMock) SwarmLeave

func (m *SwarmAPIClientMock) SwarmLeave(ctx context.Context, force bool) error

SwarmLeave leaves the Swarm.

func (*SwarmAPIClientMock) SwarmUnlock

func (m *SwarmAPIClientMock) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error

SwarmUnlock unlocks locked swarm.

func (*SwarmAPIClientMock) SwarmUpdate

func (m *SwarmAPIClientMock) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error

SwarmUpdate updates the Swarm.

type SystemAPIClientMock

type SystemAPIClientMock struct {
	*mock.Mock
}

SystemAPIClientMock defines API client methods for the system.

func (*SystemAPIClientMock) DiskUsage

func (m *SystemAPIClientMock) DiskUsage(ctx context.Context) (types.DiskUsage, error)

DiskUsage requests the current data usage from the daemon

func (*SystemAPIClientMock) Events

func (m *SystemAPIClientMock) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error)

Events returns a stream of events in the daemon. It's up to the caller to close the stream by canceling the context. Once the stream has been completely read an io.EOF error will be sent over the error channel. If an error is sent all processing will be stopped. It's up to the caller to reopen the stream in the event of an error by reinvoking this method.

func (*SystemAPIClientMock) Info

Info returns information about the docker server.

func (*SystemAPIClientMock) Ping

Ping pings the server and return the value of the "Docker-Experimental" "API-Version" headers

func (*SystemAPIClientMock) RegistryLogin

RegistryLogin authenticates the docker server with a given docker registry. It returns UnauthorizerError when the authentication fails.

type VolumeAPIClientMock

type VolumeAPIClientMock struct {
	*mock.Mock
}

VolumeAPIClientMock defines API client methods for the volumes.

func (*VolumeAPIClientMock) VolumeCreate

VolumeCreate creates a volume in the docker host.

func (*VolumeAPIClientMock) VolumeInspect

func (m *VolumeAPIClientMock) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error)

VolumeInspect returns the information about a specific volume in the docker host.

func (*VolumeAPIClientMock) VolumeInspectWithRaw

func (m *VolumeAPIClientMock) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error)

VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation.

func (*VolumeAPIClientMock) VolumeList

VolumeList returns the volumes configured in the docker host.

func (*VolumeAPIClientMock) VolumeRemove

func (m *VolumeAPIClientMock) VolumeRemove(ctx context.Context, volumeID string, force bool) error

VolumeRemove removes a volume from the docker host.

func (*VolumeAPIClientMock) VolumesPrune

func (m *VolumeAPIClientMock) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (types.VolumesPruneReport, error)

VolumesPrune requests the daemon to delete unused data.

Jump to

Keyboard shortcuts

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