Documentation ¶
Index ¶
- type MockDockerClient
- func (c MockDockerClient) ContainerCreate(ctx context.Context, command []string, envvars []string, image string, ...) (dockercontainer.ContainerCreateCreatedBody, error)
- func (c MockDockerClient) ContainerDiff(ctx context.Context, containerID string) ([]types.ChangedFile, error)
- func (c *MockDockerClient) ContainerExecAttach(ctx context.Context, execID string) (dockertypes.HijackedResponse, error)
- func (c *MockDockerClient) ContainerExecCreate(ctx context.Context, containerID string, cmd []string, attachStdout bool, ...) (dockertypes.IDResponse, error)
- func (c *MockDockerClient) ContainerExecInspect(ctx context.Context, execID string) (dockertypes.ContainerExecInspect, error)
- func (c *MockDockerClient) ContainerExecStart(ctx context.Context, execID string) error
- func (c MockDockerClient) ContainerInspect(ctx context.Context, containerID string) (dockertypes.ContainerJSON, error)
- func (c MockDockerClient) ContainerList(ctx context.Context) ([]string, error)
- func (c MockDockerClient) ContainerLogs(ctx context.Context, containerID string) (string, error)
- func (c MockDockerClient) ContainerRemove(ctx context.Context, containerID string, force bool) error
- func (c MockDockerClient) ContainerStart(ctx context.Context, containerID string) error
- func (c MockDockerClient) CopyFromContainer(ctx context.Context, container, srcPath string, followSymlink bool) (io.ReadCloser, dockertypes.ContainerPathStat, error)
- func (c MockDockerClient) HostID(ctx context.Context) string
- func (c MockDockerClient) ImageExists(ctx context.Context, imageName string) bool
- func (c MockDockerClient) ImageInspect(ctx context.Context, imageName string) (dockertypes.ImageInspect, error)
- func (c MockDockerClient) ImagePull(ctx context.Context, imageName string) error
- func (c MockDockerClient) ServerVersion(ctx context.Context) (dockertypes.Version, error)
- type MockNetConn
- func (c MockNetConn) Close() error
- func (c MockNetConn) LocalAddr() net.Addr
- func (c MockNetConn) Read(b []byte) (n int, err error)
- func (c MockNetConn) RemoteAddr() net.Addr
- func (c MockNetConn) SetDeadline(t time.Time) error
- func (c MockNetConn) SetReadDeadline(t time.Time) error
- func (c MockNetConn) SetWriteDeadline(t time.Time) error
- func (c MockNetConn) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockDockerClient ¶
type MockDockerClient struct { Type string ImagePullFn func(ctx context.Context, imageName string) error ContainerInspectFn func(ctx context.Context, containerID string) (dockertypes.ContainerJSON, error) ContainerCreateFn func(ctx context.Context, command []string, envvars []string, image string, binds []string, links []string, kernelCapabilities []string, pidMode string, containerName string) (dockercontainer.ContainerCreateCreatedBody, error) ImageExistsFn func(ctx context.Context, imageName string) bool ContainerRemoveFn func(ctx context.Context, containerID string, force bool) error ContainerStartFn func(ctx context.Context, containerID string) error ContainerLogsFn func(ctx context.Context, containerID string) (string, error) ContainerListFn func(ctx context.Context) ([]string, error) ContainerExecCreateFn func(ctx context.Context, containerID string, cmd []string, attachStdout bool, attachStderr bool) (dockertypes.IDResponse, error) ContainerExecStartFn func(ctx context.Context, execID string) error ContainerExecAttachFn func(ctx context.Context, execID string) (dockertypes.HijackedResponse, error) ContainerExecInspectFn func(ctx context.Context, execID string) (dockertypes.ContainerExecInspect, error) ImageInspectFn func(ctx context.Context, imageName string) (dockertypes.ImageInspect, error) CopyFromContainerFn func(ctx context.Context, container, srcPath string, followSymlink bool) (io.ReadCloser, dockertypes.ContainerPathStat, error) ContainerDiffFn func(ctx context.Context, containerID string) ([]types.ChangedFile, error) HostIDFn func(ctx context.Context) string ServerVersionFn func(ctx context.Context) (dockertypes.Version, error) }
MockDockerClient is a mock type implementing the dockeradapter.Client interface, by default all interface functions will raise a panic, you can however provide your own test specific function implementations which will take precedence. Refer to the dockerruntime_test.go file for examples
func (MockDockerClient) ContainerCreate ¶
func (c MockDockerClient) ContainerCreate(ctx context.Context, command []string, envvars []string, image string, binds []string, links []string, kernelCapabilities []string, pidMode string, containerName string) (dockercontainer.ContainerCreateCreatedBody, error)
ContainerCreate is a mock implementation of dockeradapter.ContainerCreate
func (MockDockerClient) ContainerDiff ¶
func (c MockDockerClient) ContainerDiff(ctx context.Context, containerID string) ([]types.ChangedFile, error)
ContainerDiff is a mock implementation of dockeradapter.ContainerDiff
func (*MockDockerClient) ContainerExecAttach ¶
func (c *MockDockerClient) ContainerExecAttach(ctx context.Context, execID string) (dockertypes.HijackedResponse, error)
ContainerExecAttach is a mock implementation of dockeradapter.ContainerExecAttach
func (*MockDockerClient) ContainerExecCreate ¶
func (c *MockDockerClient) ContainerExecCreate(ctx context.Context, containerID string, cmd []string, attachStdout bool, attachStderr bool) (dockertypes.IDResponse, error)
ContainerExecCreate is a mock implementation of dockeradapter.ContainerExecCreate
func (*MockDockerClient) ContainerExecInspect ¶
func (c *MockDockerClient) ContainerExecInspect(ctx context.Context, execID string) (dockertypes.ContainerExecInspect, error)
ContainerExecInspect is a mock implementation of dockeradapter.ContainerExecInspect
func (*MockDockerClient) ContainerExecStart ¶
func (c *MockDockerClient) ContainerExecStart(ctx context.Context, execID string) error
ContainerExecStart is a mock implementation of dockeradapter.ContainerExecStart
func (MockDockerClient) ContainerInspect ¶
func (c MockDockerClient) ContainerInspect(ctx context.Context, containerID string) (dockertypes.ContainerJSON, error)
ContainerInspect is a mock implementation of dockeradapter.ContainerInspect
func (MockDockerClient) ContainerList ¶
func (c MockDockerClient) ContainerList(ctx context.Context) ([]string, error)
ContainerList is a mock implementation of dockeradapter.ContainerList
func (MockDockerClient) ContainerLogs ¶
ContainerLogs is a mock implementation of dockeradapter.ContainerLogs
func (MockDockerClient) ContainerRemove ¶
func (c MockDockerClient) ContainerRemove(ctx context.Context, containerID string, force bool) error
ContainerRemove is a mock implementation of dockeradapter.ContainerRemove
func (MockDockerClient) ContainerStart ¶
func (c MockDockerClient) ContainerStart(ctx context.Context, containerID string) error
ContainerStart is a mock implementation of dockeradapter.ContainerStart
func (MockDockerClient) CopyFromContainer ¶
func (c MockDockerClient) CopyFromContainer(ctx context.Context, container, srcPath string, followSymlink bool) (io.ReadCloser, dockertypes.ContainerPathStat, error)
CopyFromContainer is a mock implementation of dockeradapter.CopyFromContainer
func (MockDockerClient) HostID ¶
func (c MockDockerClient) HostID(ctx context.Context) string
HostID is a mock implementation of dockeradapter.HostID
func (MockDockerClient) ImageExists ¶
func (c MockDockerClient) ImageExists(ctx context.Context, imageName string) bool
ImageExists is a mock implementation of dockeradapter.ImageExists
func (MockDockerClient) ImageInspect ¶
func (c MockDockerClient) ImageInspect(ctx context.Context, imageName string) (dockertypes.ImageInspect, error)
ImageInspect is a mock implementation of dockeradapter.ImageInspect
func (MockDockerClient) ImagePull ¶
func (c MockDockerClient) ImagePull(ctx context.Context, imageName string) error
ImagePull is a mock implementation of dockeradapter.ImagePull
func (MockDockerClient) ServerVersion ¶
func (c MockDockerClient) ServerVersion(ctx context.Context) (dockertypes.Version, error)
ServerVersion is a mock implementation of dockeradapter.ServerVersion
type MockNetConn ¶
type MockNetConn struct { ReadFn func(b []byte) (n int, err error) WriteFn func(b []byte) (n int, err error) CloseFn func() error LocalAddrFn func() net.Addr RemoteAddrFn func() net.Addr SetDeadlineFn func(t time.Time) error SetReadDeadlineFn func(t time.Time) error SetWriteDeadlineFn func(t time.Time) error }
MockNetConn TODO
func (MockNetConn) SetDeadline ¶
func (c MockNetConn) SetDeadline(t time.Time) error
SetDeadline TODO
func (MockNetConn) SetReadDeadline ¶
func (c MockNetConn) SetReadDeadline(t time.Time) error
SetReadDeadline TODO
func (MockNetConn) SetWriteDeadline ¶
func (c MockNetConn) SetWriteDeadline(t time.Time) error
SetWriteDeadline TODO