mirror of https://github.com/docker/docs.git
Updating mock and nop clients for updated engine-api
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
This commit is contained in:
parent
04a9533b09
commit
8fd494ba58
|
|
@ -3,7 +3,6 @@ package mockclient
|
|||
import (
|
||||
"io"
|
||||
|
||||
"github.com/docker/engine-api/client"
|
||||
"github.com/docker/engine-api/types"
|
||||
"github.com/docker/engine-api/types/container"
|
||||
"github.com/docker/engine-api/types/filters"
|
||||
|
|
@ -29,15 +28,33 @@ func (client *MockClient) ClientVersion() string {
|
|||
return args.String(0)
|
||||
}
|
||||
|
||||
// CheckpointCreate creates a checkpoint from the given container with the given name
|
||||
func (client *MockClient) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error {
|
||||
args := client.Mock.Called(ctx, container, options)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// CheckpointDelete deletes the checkpoint with the given name from the given container
|
||||
func (client *MockClient) CheckpointDelete(ctx context.Context, container string, checkpointID string) error {
|
||||
args := client.Mock.Called(ctx, container, checkpointID)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// CheckpointList returns the volumes configured in the docker host
|
||||
func (client *MockClient) CheckpointList(ctx context.Context, container string) ([]types.Checkpoint, error) {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Get(0).([]types.Checkpoint), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerAttach attaches a connection to a container in the server
|
||||
func (client *MockClient) ContainerAttach(ctx context.Context, options types.ContainerAttachOptions) (types.HijackedResponse, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) {
|
||||
args := client.Mock.Called(ctx, container, options)
|
||||
return args.Get(0).(types.HijackedResponse), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerCommit applies changes into a container and creates a new tagged image
|
||||
func (client *MockClient) ContainerCommit(ctx context.Context, options types.ContainerCommitOptions) (types.ContainerCommitResponse, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.ContainerCommitResponse, error) {
|
||||
args := client.Mock.Called(ctx, container, options)
|
||||
return args.Get(0).(types.ContainerCommitResponse), args.Error(1)
|
||||
}
|
||||
|
||||
|
|
@ -48,8 +65,8 @@ func (client *MockClient) ContainerCreate(ctx context.Context, config *container
|
|||
}
|
||||
|
||||
// ContainerDiff shows differences in a container filesystem since it was started
|
||||
func (client *MockClient) ContainerDiff(ctx context.Context, containerID string) ([]types.ContainerChange, error) {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerDiff(ctx context.Context, container string) ([]types.ContainerChange, error) {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Get(0).([]types.ContainerChange), args.Error(1)
|
||||
}
|
||||
|
||||
|
|
@ -60,8 +77,8 @@ func (client *MockClient) ContainerExecAttach(ctx context.Context, execID string
|
|||
}
|
||||
|
||||
// ContainerExecCreate creates a new exec configuration to run an exec process
|
||||
func (client *MockClient) ContainerExecCreate(ctx context.Context, config types.ExecConfig) (types.ContainerExecCreateResponse, error) {
|
||||
args := client.Mock.Called(ctx, config)
|
||||
func (client *MockClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.ContainerExecCreateResponse, error) {
|
||||
args := client.Mock.Called(ctx, container, config)
|
||||
return args.Get(0).(types.ContainerExecCreateResponse), args.Error(1)
|
||||
}
|
||||
|
||||
|
|
@ -72,8 +89,8 @@ func (client *MockClient) ContainerExecInspect(ctx context.Context, execID strin
|
|||
}
|
||||
|
||||
// ContainerExecResize changes the size of the tty for an exec process running inside a container
|
||||
func (client *MockClient) ContainerExecResize(ctx context.Context, options types.ResizeOptions) error {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error {
|
||||
args := client.Mock.Called(ctx, execID, options)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
|
|
@ -84,26 +101,26 @@ func (client *MockClient) ContainerExecStart(ctx context.Context, execID string,
|
|||
}
|
||||
|
||||
// ContainerExport retrieves the raw contents of a container and returns them as an io.ReadCloser
|
||||
func (client *MockClient) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerInspect returns the container information
|
||||
func (client *MockClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Get(0).(types.ContainerJSON), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerInspectWithRaw returns the container information and its raw representation
|
||||
func (client *MockClient) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (types.ContainerJSON, []byte, error) {
|
||||
args := client.Mock.Called(ctx, containerID, getSize)
|
||||
func (client *MockClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) {
|
||||
args := client.Mock.Called(ctx, container, getSize)
|
||||
return args.Get(0).(types.ContainerJSON), args.Get(1).([]byte), args.Error(2)
|
||||
}
|
||||
|
||||
// ContainerKill terminates the container process but does not remove the container from the docker host
|
||||
func (client *MockClient) ContainerKill(ctx context.Context, containerID, signal string) error {
|
||||
args := client.Mock.Called(ctx, containerID, signal)
|
||||
func (client *MockClient) ContainerKill(ctx context.Context, container, signal string) error {
|
||||
args := client.Mock.Called(ctx, container, signal)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
|
|
@ -114,98 +131,98 @@ func (client *MockClient) ContainerList(ctx context.Context, options types.Conta
|
|||
}
|
||||
|
||||
// ContainerLogs returns the logs generated by a container in an io.ReadCloser
|
||||
func (client *MockClient) ContainerLogs(ctx context.Context, options types.ContainerLogsOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, container, options)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerPause pauses the main process of a given container without terminating it
|
||||
func (client *MockClient) ContainerPause(ctx context.Context, containerID string) error {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerPause(ctx context.Context, container string) error {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerRemove kills and removes a container from the docker host
|
||||
func (client *MockClient) ContainerRemove(ctx context.Context, options types.ContainerRemoveOptions) error {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error {
|
||||
args := client.Mock.Called(ctx, container, options)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerRename changes the name of a given container
|
||||
func (client *MockClient) ContainerRename(ctx context.Context, containerID, newContainerName string) error {
|
||||
args := client.Mock.Called(ctx, containerID, newContainerName)
|
||||
func (client *MockClient) ContainerRename(ctx context.Context, container, newContainerName string) error {
|
||||
args := client.Mock.Called(ctx, container, newContainerName)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerResize changes the size of the tty for a container
|
||||
func (client *MockClient) ContainerResize(ctx context.Context, options types.ResizeOptions) error {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error {
|
||||
args := client.Mock.Called(ctx, container, options)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerRestart stops and starts a container again
|
||||
func (client *MockClient) ContainerRestart(ctx context.Context, containerID string, timeout int) error {
|
||||
args := client.Mock.Called(ctx, containerID, timeout)
|
||||
func (client *MockClient) ContainerRestart(ctx context.Context, container string, timeout int) error {
|
||||
args := client.Mock.Called(ctx, container, timeout)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerStatPath returns Stat information about a path inside the container filesystem
|
||||
func (client *MockClient) ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error) {
|
||||
args := client.Mock.Called(ctx, containerID, path)
|
||||
func (client *MockClient) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) {
|
||||
args := client.Mock.Called(ctx, container, path)
|
||||
return args.Get(0).(types.ContainerPathStat), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerStats returns near realtime stats for a given container
|
||||
func (client *MockClient) ContainerStats(ctx context.Context, containerID string, stream bool) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, containerID, stream)
|
||||
func (client *MockClient) ContainerStats(ctx context.Context, container string, stream bool) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, container, stream)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerStart sends a request to the docker daemon to start a container
|
||||
func (client *MockClient) ContainerStart(ctx context.Context, containerID string) error {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerStart(ctx context.Context, container string, checkpointID string) error {
|
||||
args := client.Mock.Called(ctx, container, checkpointID)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerStop stops a container without terminating the process
|
||||
func (client *MockClient) ContainerStop(ctx context.Context, containerID string, timeout int) error {
|
||||
args := client.Mock.Called(ctx, containerID, timeout)
|
||||
func (client *MockClient) ContainerStop(ctx context.Context, container string, timeout int) error {
|
||||
args := client.Mock.Called(ctx, container, timeout)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerTop shows process information from within a container
|
||||
func (client *MockClient) ContainerTop(ctx context.Context, containerID string, arguments []string) (types.ContainerProcessList, error) {
|
||||
args := client.Mock.Called(ctx, containerID, arguments)
|
||||
func (client *MockClient) ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error) {
|
||||
args := client.Mock.Called(ctx, container, arguments)
|
||||
return args.Get(0).(types.ContainerProcessList), args.Error(1)
|
||||
}
|
||||
|
||||
// ContainerUnpause resumes the process execution within a container
|
||||
func (client *MockClient) ContainerUnpause(ctx context.Context, containerID string) error {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerUnpause(ctx context.Context, container string) error {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerUpdate updates resources of a container
|
||||
func (client *MockClient) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) error {
|
||||
args := client.Mock.Called(ctx, containerID, updateConfig)
|
||||
func (client *MockClient) ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) error {
|
||||
args := client.Mock.Called(ctx, container, updateConfig)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// ContainerWait pauses execution until a container exits
|
||||
func (client *MockClient) ContainerWait(ctx context.Context, containerID string) (int, error) {
|
||||
args := client.Mock.Called(ctx, containerID)
|
||||
func (client *MockClient) ContainerWait(ctx context.Context, container string) (int, error) {
|
||||
args := client.Mock.Called(ctx, container)
|
||||
return args.Int(0), args.Error(1)
|
||||
}
|
||||
|
||||
// CopyFromContainer gets the content from the container and returns it as a Reader to manipulate it in the host
|
||||
func (client *MockClient) CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
|
||||
args := client.Mock.Called(ctx, containerID, srcPath)
|
||||
func (client *MockClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
|
||||
args := client.Mock.Called(ctx, container, srcPath)
|
||||
return args.Get(0).(io.ReadCloser), args.Get(1).(types.ContainerPathStat), args.Error(2)
|
||||
}
|
||||
|
||||
// CopyToContainer copies content into the container filesystem
|
||||
func (client *MockClient) CopyToContainer(ctx context.Context, options types.CopyToContainerOptions) error {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error {
|
||||
args := client.Mock.Called(ctx, container, path, content, options)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
|
|
@ -216,32 +233,32 @@ func (client *MockClient) Events(ctx context.Context, options types.EventsOption
|
|||
}
|
||||
|
||||
// ImageBuild sends request to the daemon to build images
|
||||
func (client *MockClient) ImageBuild(ctx context.Context, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
|
||||
args := client.Mock.Called(ctx, context, options)
|
||||
return args.Get(0).(types.ImageBuildResponse), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageCreate creates a new image based in the parent options
|
||||
func (client *MockClient) ImageCreate(ctx context.Context, options types.ImageCreateOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, parentReference, options)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageHistory returns the changes in an image in history format
|
||||
func (client *MockClient) ImageHistory(ctx context.Context, imageID string) ([]types.ImageHistory, error) {
|
||||
args := client.Mock.Called(ctx, imageID)
|
||||
func (client *MockClient) ImageHistory(ctx context.Context, image string) ([]types.ImageHistory, error) {
|
||||
args := client.Mock.Called(ctx, image)
|
||||
return args.Get(0).([]types.ImageHistory), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageImport creates a new image based in the source options
|
||||
func (client *MockClient) ImageImport(ctx context.Context, options types.ImageImportOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, source, ref, options)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageInspectWithRaw returns the image information and it's raw representation
|
||||
func (client *MockClient) ImageInspectWithRaw(ctx context.Context, imageID string, getSize bool) (types.ImageInspect, []byte, error) {
|
||||
args := client.Mock.Called(ctx, imageID, getSize)
|
||||
func (client *MockClient) ImageInspectWithRaw(ctx context.Context, image string, getSize bool) (types.ImageInspect, []byte, error) {
|
||||
args := client.Mock.Called(ctx, image, getSize)
|
||||
return args.Get(0).(types.ImageInspect), args.Get(1).([]byte), args.Error(2)
|
||||
}
|
||||
|
||||
|
|
@ -258,38 +275,38 @@ func (client *MockClient) ImageLoad(ctx context.Context, input io.Reader, quiet
|
|||
}
|
||||
|
||||
// ImagePull requests the docker host to pull an image from a remote registry
|
||||
func (client *MockClient) ImagePull(ctx context.Context, options types.ImagePullOptions, privilegeFunc client.RequestPrivilegeFunc) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, options, privilegeFunc)
|
||||
func (client *MockClient) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, ref, options)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ImagePush requests the docker host to push an image to a remote registry
|
||||
func (client *MockClient) ImagePush(ctx context.Context, options types.ImagePushOptions, privilegeFunc client.RequestPrivilegeFunc) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, options, privilegeFunc)
|
||||
func (client *MockClient) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, ref, options)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageRemove removes an image from the docker host
|
||||
func (client *MockClient) ImageRemove(ctx context.Context, options types.ImageRemoveOptions) ([]types.ImageDelete, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDelete, error) {
|
||||
args := client.Mock.Called(ctx, image, options)
|
||||
return args.Get(0).([]types.ImageDelete), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageSearch makes the docker host to search by a term in a remote registry
|
||||
func (client *MockClient) ImageSearch(ctx context.Context, options types.ImageSearchOptions, privilegeFunc client.RequestPrivilegeFunc) ([]registry.SearchResult, error) {
|
||||
args := client.Mock.Called(ctx, options, privilegeFunc)
|
||||
func (client *MockClient) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) {
|
||||
args := client.Mock.Called(ctx, term, options)
|
||||
return args.Get(0).([]registry.SearchResult), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageSave retrieves one or more images from the docker host as an io.ReadCloser
|
||||
func (client *MockClient) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, imageIDs)
|
||||
func (client *MockClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) {
|
||||
args := client.Mock.Called(ctx, images)
|
||||
return args.Get(0).(io.ReadCloser), args.Error(1)
|
||||
}
|
||||
|
||||
// ImageTag tags an image in the docker host
|
||||
func (client *MockClient) ImageTag(ctx context.Context, options types.ImageTagOptions) error {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) ImageTag(ctx context.Context, image, ref string, options types.ImageTagOptions) error {
|
||||
args := client.Mock.Called(ctx, image, ref, options)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
|
|
@ -300,20 +317,20 @@ func (client *MockClient) Info(ctx context.Context) (types.Info, error) {
|
|||
}
|
||||
|
||||
// NetworkConnect connects a container to an existent network in the docker host
|
||||
func (client *MockClient) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error {
|
||||
args := client.Mock.Called(ctx, networkID, containerID, config)
|
||||
func (client *MockClient) NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error {
|
||||
args := client.Mock.Called(ctx, networkID, container, config)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
// NetworkCreate creates a new network in the docker host
|
||||
func (client *MockClient) NetworkCreate(ctx context.Context, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
func (client *MockClient) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
|
||||
args := client.Mock.Called(ctx, name, options)
|
||||
return args.Get(0).(types.NetworkCreateResponse), args.Error(1)
|
||||
}
|
||||
|
||||
// NetworkDisconnect disconnects a container from an existent network in the docker host
|
||||
func (client *MockClient) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error {
|
||||
args := client.Mock.Called(ctx, networkID, containerID, force)
|
||||
func (client *MockClient) NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error {
|
||||
args := client.Mock.Called(ctx, networkID, container, force)
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
|
|
@ -323,6 +340,12 @@ func (client *MockClient) NetworkInspect(ctx context.Context, networkID string)
|
|||
return args.Get(0).(types.NetworkResource), args.Error(1)
|
||||
}
|
||||
|
||||
// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and it's raw representation
|
||||
func (client *MockClient) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) {
|
||||
args := client.Mock.Called(ctx, networkID)
|
||||
return args.Get(0).(types.NetworkResource), args.Get(1).([]byte), args.Error(2)
|
||||
}
|
||||
|
||||
// NetworkList returns the list of networks configured in the docker host
|
||||
func (client *MockClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
|
||||
args := client.Mock.Called(ctx, options)
|
||||
|
|
@ -363,6 +386,12 @@ func (client *MockClient) VolumeInspect(ctx context.Context, volumeID string) (t
|
|||
return args.Get(0).(types.Volume), args.Error(1)
|
||||
}
|
||||
|
||||
// VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation
|
||||
func (client *MockClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
|
||||
args := client.Mock.Called(ctx, volumeID)
|
||||
return args.Get(0).(types.Volume), args.Get(1).([]byte), args.Error(2)
|
||||
}
|
||||
|
||||
// VolumeList returns the volumes configured in the docker host
|
||||
func (client *MockClient) VolumeList(ctx context.Context, filter filters.Args) (types.VolumesListResponse, error) {
|
||||
args := client.Mock.Called(ctx, filter)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/docker/engine-api/client"
|
||||
"github.com/docker/engine-api/types"
|
||||
"github.com/docker/engine-api/types/container"
|
||||
"github.com/docker/engine-api/types/filters"
|
||||
|
|
@ -32,13 +31,28 @@ func (client *NopClient) ClientVersion() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// CheckpointCreate creates a checkpoint from the given container with the given name
|
||||
func (client *NopClient) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// CheckpointDelete deletes the checkpoint with the given name from the given container
|
||||
func (client *NopClient) CheckpointDelete(ctx context.Context, container string, checkpointID string) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// CheckpointList returns the volumes configured in the docker host
|
||||
func (client *NopClient) CheckpointList(ctx context.Context, container string) ([]types.Checkpoint, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerAttach attaches a connection to a container in the server
|
||||
func (client *NopClient) ContainerAttach(ctx context.Context, options types.ContainerAttachOptions) (types.HijackedResponse, error) {
|
||||
func (client *NopClient) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) {
|
||||
return types.HijackedResponse{}, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerCommit applies changes into a container and creates a new tagged image
|
||||
func (client *NopClient) ContainerCommit(ctx context.Context, options types.ContainerCommitOptions) (types.ContainerCommitResponse, error) {
|
||||
func (client *NopClient) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.ContainerCommitResponse, error) {
|
||||
return types.ContainerCommitResponse{}, errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +62,7 @@ func (client *NopClient) ContainerCreate(ctx context.Context, config *container.
|
|||
}
|
||||
|
||||
// ContainerDiff shows differences in a container filesystem since it was started
|
||||
func (client *NopClient) ContainerDiff(ctx context.Context, containerID string) ([]types.ContainerChange, error) {
|
||||
func (client *NopClient) ContainerDiff(ctx context.Context, container string) ([]types.ContainerChange, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +72,7 @@ func (client *NopClient) ContainerExecAttach(ctx context.Context, execID string,
|
|||
}
|
||||
|
||||
// ContainerExecCreate creates a new exec configuration to run an exec process
|
||||
func (client *NopClient) ContainerExecCreate(ctx context.Context, config types.ExecConfig) (types.ContainerExecCreateResponse, error) {
|
||||
func (client *NopClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.ContainerExecCreateResponse, error) {
|
||||
return types.ContainerExecCreateResponse{}, errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +82,7 @@ func (client *NopClient) ContainerExecInspect(ctx context.Context, execID string
|
|||
}
|
||||
|
||||
// ContainerExecResize changes the size of the tty for an exec process running inside a container
|
||||
func (client *NopClient) ContainerExecResize(ctx context.Context, options types.ResizeOptions) error {
|
||||
func (client *NopClient) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -78,22 +92,22 @@ func (client *NopClient) ContainerExecStart(ctx context.Context, execID string,
|
|||
}
|
||||
|
||||
// ContainerExport retrieves the raw contents of a container and returns them as an io.ReadCloser
|
||||
func (client *NopClient) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerInspect returns the container information
|
||||
func (client *NopClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
|
||||
func (client *NopClient) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) {
|
||||
return types.ContainerJSON{}, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerInspectWithRaw returns the container information and its raw representation
|
||||
func (client *NopClient) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (types.ContainerJSON, []byte, error) {
|
||||
func (client *NopClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) {
|
||||
return types.ContainerJSON{}, nil, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerKill terminates the container process but does not remove the container from the docker host
|
||||
func (client *NopClient) ContainerKill(ctx context.Context, containerID, signal string) error {
|
||||
func (client *NopClient) ContainerKill(ctx context.Context, container, signal string) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -103,82 +117,82 @@ func (client *NopClient) ContainerList(ctx context.Context, options types.Contai
|
|||
}
|
||||
|
||||
// ContainerLogs returns the logs generated by a container in an io.ReadCloser
|
||||
func (client *NopClient) ContainerLogs(ctx context.Context, options types.ContainerLogsOptions) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerPause pauses the main process of a given container without terminating it
|
||||
func (client *NopClient) ContainerPause(ctx context.Context, containerID string) error {
|
||||
func (client *NopClient) ContainerPause(ctx context.Context, container string) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerRemove kills and removes a container from the docker host
|
||||
func (client *NopClient) ContainerRemove(ctx context.Context, options types.ContainerRemoveOptions) error {
|
||||
func (client *NopClient) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerRename changes the name of a given container
|
||||
func (client *NopClient) ContainerRename(ctx context.Context, containerID, newContainerName string) error {
|
||||
func (client *NopClient) ContainerRename(ctx context.Context, container, newContainerName string) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerResize changes the size of the tty for a container
|
||||
func (client *NopClient) ContainerResize(ctx context.Context, options types.ResizeOptions) error {
|
||||
func (client *NopClient) ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerRestart stops and starts a container again
|
||||
func (client *NopClient) ContainerRestart(ctx context.Context, containerID string, timeout int) error {
|
||||
func (client *NopClient) ContainerRestart(ctx context.Context, container string, timeout int) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerStatPath returns Stat information about a path inside the container filesystem
|
||||
func (client *NopClient) ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error) {
|
||||
func (client *NopClient) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) {
|
||||
return types.ContainerPathStat{}, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerStats returns near realtime stats for a given container
|
||||
func (client *NopClient) ContainerStats(ctx context.Context, containerID string, stream bool) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ContainerStats(ctx context.Context, container string, stream bool) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerStart sends a request to the docker daemon to start a container
|
||||
func (client *NopClient) ContainerStart(ctx context.Context, containerID string) error {
|
||||
func (client *NopClient) ContainerStart(ctx context.Context, container string, checkpointID string) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerStop stops a container without terminating the process
|
||||
func (client *NopClient) ContainerStop(ctx context.Context, containerID string, timeout int) error {
|
||||
func (client *NopClient) ContainerStop(ctx context.Context, container string, timeout int) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerTop shows process information from within a container
|
||||
func (client *NopClient) ContainerTop(ctx context.Context, containerID string, arguments []string) (types.ContainerProcessList, error) {
|
||||
func (client *NopClient) ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error) {
|
||||
return types.ContainerProcessList{}, errNoEngine
|
||||
}
|
||||
|
||||
// ContainerUnpause resumes the process execution within a container
|
||||
func (client *NopClient) ContainerUnpause(ctx context.Context, containerID string) error {
|
||||
func (client *NopClient) ContainerUnpause(ctx context.Context, container string) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerUpdate updates resources of a container
|
||||
func (client *NopClient) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) error {
|
||||
func (client *NopClient) ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// ContainerWait pauses execution until a container exits
|
||||
func (client *NopClient) ContainerWait(ctx context.Context, containerID string) (int, error) {
|
||||
func (client *NopClient) ContainerWait(ctx context.Context, container string) (int, error) {
|
||||
return 0, errNoEngine
|
||||
}
|
||||
|
||||
// CopyFromContainer gets the content from the container and returns it as a Reader to manipulate it in the host
|
||||
func (client *NopClient) CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
|
||||
func (client *NopClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
|
||||
return nil, types.ContainerPathStat{}, errNoEngine
|
||||
}
|
||||
|
||||
// CopyToContainer copies content into the container filesystem
|
||||
func (client *NopClient) CopyToContainer(ctx context.Context, options types.CopyToContainerOptions) error {
|
||||
func (client *NopClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -188,27 +202,27 @@ func (client *NopClient) Events(ctx context.Context, options types.EventsOptions
|
|||
}
|
||||
|
||||
// ImageBuild sends request to the daemon to build images
|
||||
func (client *NopClient) ImageBuild(ctx context.Context, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
|
||||
func (client *NopClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
|
||||
return types.ImageBuildResponse{}, errNoEngine
|
||||
}
|
||||
|
||||
// ImageCreate creates a new image based in the parent options
|
||||
func (client *NopClient) ImageCreate(ctx context.Context, options types.ImageCreateOptions) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageHistory returns the changes in an image in history format
|
||||
func (client *NopClient) ImageHistory(ctx context.Context, imageID string) ([]types.ImageHistory, error) {
|
||||
func (client *NopClient) ImageHistory(ctx context.Context, image string) ([]types.ImageHistory, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageImport creates a new image based in the source options
|
||||
func (client *NopClient) ImageImport(ctx context.Context, options types.ImageImportOptions) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageInspectWithRaw returns the image information and it's raw representation
|
||||
func (client *NopClient) ImageInspectWithRaw(ctx context.Context, imageID string, getSize bool) (types.ImageInspect, []byte, error) {
|
||||
func (client *NopClient) ImageInspectWithRaw(ctx context.Context, image string, getSize bool) (types.ImageInspect, []byte, error) {
|
||||
return types.ImageInspect{}, nil, errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -223,32 +237,32 @@ func (client *NopClient) ImageLoad(ctx context.Context, input io.Reader, quiet b
|
|||
}
|
||||
|
||||
// ImagePull requests the docker host to pull an image from a remote registry
|
||||
func (client *NopClient) ImagePull(ctx context.Context, options types.ImagePullOptions, privilegeFunc client.RequestPrivilegeFunc) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImagePush requests the docker host to push an image to a remote registry
|
||||
func (client *NopClient) ImagePush(ctx context.Context, options types.ImagePushOptions, privilegeFunc client.RequestPrivilegeFunc) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageRemove removes an image from the docker host
|
||||
func (client *NopClient) ImageRemove(ctx context.Context, options types.ImageRemoveOptions) ([]types.ImageDelete, error) {
|
||||
func (client *NopClient) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDelete, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageSearch makes the docker host to search by a term in a remote registry
|
||||
func (client *NopClient) ImageSearch(ctx context.Context, options types.ImageSearchOptions, privilegeFunc client.RequestPrivilegeFunc) ([]registry.SearchResult, error) {
|
||||
func (client *NopClient) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageSave retrieves one or more images from the docker host as an io.ReadCloser
|
||||
func (client *NopClient) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) {
|
||||
func (client *NopClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) {
|
||||
return nil, errNoEngine
|
||||
}
|
||||
|
||||
// ImageTag tags an image in the docker host
|
||||
func (client *NopClient) ImageTag(ctx context.Context, options types.ImageTagOptions) error {
|
||||
func (client *NopClient) ImageTag(ctx context.Context, image, ref string, options types.ImageTagOptions) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -258,17 +272,17 @@ func (client *NopClient) Info(ctx context.Context) (types.Info, error) {
|
|||
}
|
||||
|
||||
// NetworkConnect connects a container to an existent network in the docker host
|
||||
func (client *NopClient) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error {
|
||||
func (client *NopClient) NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
// NetworkCreate creates a new network in the docker host
|
||||
func (client *NopClient) NetworkCreate(ctx context.Context, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
|
||||
func (client *NopClient) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
|
||||
return types.NetworkCreateResponse{}, errNoEngine
|
||||
}
|
||||
|
||||
// NetworkDisconnect disconnects a container from an existent network in the docker host
|
||||
func (client *NopClient) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error {
|
||||
func (client *NopClient) NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error {
|
||||
return errNoEngine
|
||||
}
|
||||
|
||||
|
|
@ -277,6 +291,11 @@ func (client *NopClient) NetworkInspect(ctx context.Context, networkID string) (
|
|||
return types.NetworkResource{}, errNoEngine
|
||||
}
|
||||
|
||||
// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and it's raw representation
|
||||
func (client *NopClient) NetworkInspectWithRaw(ctx context.Context, networkID string) (types.NetworkResource, []byte, error) {
|
||||
return types.NetworkResource{}, nil, errNoEngine
|
||||
}
|
||||
|
||||
// NetworkList returns the list of networks configured in the docker host
|
||||
func (client *NopClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
|
||||
return nil, errNoEngine
|
||||
|
|
@ -311,6 +330,11 @@ func (client *NopClient) VolumeInspect(ctx context.Context, volumeID string) (ty
|
|||
return types.Volume{}, errNoEngine
|
||||
}
|
||||
|
||||
// VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation
|
||||
func (client *NopClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
|
||||
return types.Volume{}, nil, errNoEngine
|
||||
}
|
||||
|
||||
// VolumeList returns the volumes configured in the docker host
|
||||
func (client *NopClient) VolumeList(ctx context.Context, filter filters.Args) (types.VolumesListResponse, error) {
|
||||
return types.VolumesListResponse{}, errNoEngine
|
||||
|
|
|
|||
Loading…
Reference in New Issue