Documentation ¶
Index ¶
- type FakeConn
- func (c FakeConn) Close() error
- func (c FakeConn) LocalAddr() net.Addr
- func (c FakeConn) Read(b []byte) (n int, err error)
- func (c FakeConn) RemoteAddr() net.Addr
- func (c FakeConn) SetDeadline(t time.Time) error
- func (c FakeConn) SetReadDeadline(t time.Time) error
- func (c FakeConn) SetWriteDeadline(t time.Time) error
- func (c FakeConn) Write(b []byte) (n int, err error)
- type FakeDockerClient
- func (d *FakeDockerClient) ContainerAttach(ctx context.Context, container string, ...) (dockertypes.HijackedResponse, error)
- func (d *FakeDockerClient) ContainerCommit(ctx context.Context, container string, ...) (dockertypes.IDResponse, error)
- func (d *FakeDockerClient) ContainerCreate(ctx context.Context, config *dockercontainer.Config, ...) (dockercontainer.ContainerCreateCreatedBody, error)
- func (d *FakeDockerClient) ContainerInspect(ctx context.Context, containerID string) (dockertypes.ContainerJSON, error)
- func (d *FakeDockerClient) ContainerKill(ctx context.Context, containerID, signal string) error
- func (d *FakeDockerClient) ContainerRemove(ctx context.Context, containerID string, ...) error
- func (d *FakeDockerClient) ContainerStart(ctx context.Context, containerID string, ...) error
- func (d *FakeDockerClient) ContainerWait(ctx context.Context, containerID string, ...) (<-chan dockercontainer.ContainerWaitOKBody, <-chan error)
- func (d *FakeDockerClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, dockertypes.ContainerPathStat, error)
- func (d *FakeDockerClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, ...) error
- func (d *FakeDockerClient) ImageBuild(ctx context.Context, buildContext io.Reader, ...) (dockertypes.ImageBuildResponse, error)
- func (d *FakeDockerClient) ImageInspectWithRaw(ctx context.Context, imageID string) (dockertypes.ImageInspect, []byte, error)
- func (d *FakeDockerClient) ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error)
- func (d *FakeDockerClient) ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)
- func (d *FakeDockerClient) ImageRemove(ctx context.Context, imageID string, options dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDeleteResponseItem, error)
- func (d *FakeDockerClient) ServerVersion(ctx context.Context) (dockertypes.Version, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeConn ¶
type FakeConn struct { }
FakeConn fakes a net.Conn
func (FakeConn) RemoteAddr ¶
RemoteAddr returns the remote address
func (FakeConn) SetDeadline ¶
SetDeadline sets the deadline
func (FakeConn) SetReadDeadline ¶
SetReadDeadline sets the read deadline
func (FakeConn) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline
type FakeDockerClient ¶
type FakeDockerClient struct { CopyToContainerID string CopyToContainerPath string CopyToContainerContent io.Reader CopyFromContainerID string CopyFromContainerPath string CopyFromContainerErr error WaitContainerID string WaitContainerResult int WaitContainerErr error WaitContainerErrInspectJSON dockertypes.ContainerJSON ContainerCommitID string ContainerCommitOptions dockertypes.ContainerCommitOptions ContainerCommitResponse dockertypes.IDResponse ContainerCommitErr error BuildImageOpts dockertypes.ImageBuildOptions BuildImageErr error Images map[string]dockertypes.ImageInspect Containers map[string]dockercontainer.Config PullFail error PushFail error Calls []string }
FakeDockerClient provides a Fake client for Docker testing
func NewFakeDockerClient ¶
func NewFakeDockerClient() *FakeDockerClient
NewFakeDockerClient returns a new FakeDockerClient
func (*FakeDockerClient) ContainerAttach ¶
func (d *FakeDockerClient) ContainerAttach(ctx context.Context, container string, options dockertypes.ContainerAttachOptions) (dockertypes.HijackedResponse, error)
ContainerAttach attaches a connection to a container in the server.
func (*FakeDockerClient) ContainerCommit ¶
func (d *FakeDockerClient) ContainerCommit(ctx context.Context, container string, options dockertypes.ContainerCommitOptions) (dockertypes.IDResponse, error)
ContainerCommit applies changes into a container and creates a new tagged image.
func (*FakeDockerClient) ContainerCreate ¶
func (d *FakeDockerClient) ContainerCreate(ctx context.Context, config *dockercontainer.Config, hostConfig *dockercontainer.HostConfig, networkingConfig *dockernetwork.NetworkingConfig, containerName string) (dockercontainer.ContainerCreateCreatedBody, error)
ContainerCreate creates a new container based in the given configuration.
func (*FakeDockerClient) ContainerInspect ¶
func (d *FakeDockerClient) ContainerInspect(ctx context.Context, containerID string) (dockertypes.ContainerJSON, error)
ContainerInspect returns the container information.
func (*FakeDockerClient) ContainerKill ¶
func (d *FakeDockerClient) ContainerKill(ctx context.Context, containerID, signal string) error
ContainerKill terminates the container process but does not remove the container from the docker host.
func (*FakeDockerClient) ContainerRemove ¶
func (d *FakeDockerClient) ContainerRemove(ctx context.Context, containerID string, options dockertypes.ContainerRemoveOptions) error
ContainerRemove kills and removes a container from the docker host.
func (*FakeDockerClient) ContainerStart ¶
func (d *FakeDockerClient) ContainerStart(ctx context.Context, containerID string, options dockertypes.ContainerStartOptions) error
ContainerStart sends a request to the docker daemon to start a container.
func (*FakeDockerClient) ContainerWait ¶
func (d *FakeDockerClient) ContainerWait(ctx context.Context, containerID string, condition dockercontainer.WaitCondition) (<-chan dockercontainer.ContainerWaitOKBody, <-chan error)
ContainerWait pauses execution until a container exits.
func (*FakeDockerClient) CopyFromContainer ¶
func (d *FakeDockerClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, dockertypes.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 (*FakeDockerClient) CopyToContainer ¶
func (d *FakeDockerClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, opts dockertypes.CopyToContainerOptions) error
CopyToContainer copies content into the container filesystem.
func (*FakeDockerClient) ImageBuild ¶
func (d *FakeDockerClient) ImageBuild(ctx context.Context, buildContext io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)
ImageBuild sends request to the daemon to build images.
func (*FakeDockerClient) ImageInspectWithRaw ¶
func (d *FakeDockerClient) ImageInspectWithRaw(ctx context.Context, imageID string) (dockertypes.ImageInspect, []byte, error)
ImageInspectWithRaw returns the image information and its raw representation.
func (*FakeDockerClient) ImagePull ¶
func (d *FakeDockerClient) ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error)
ImagePull requests the docker host to pull an image from a remote registry.
func (*FakeDockerClient) ImagePush ¶
func (d *FakeDockerClient) ImagePush(ctx context.Context, ref string, options dockertypes.ImagePushOptions) (io.ReadCloser, error)
func (*FakeDockerClient) ImageRemove ¶
func (d *FakeDockerClient) ImageRemove(ctx context.Context, imageID string, options dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDeleteResponseItem, error)
ImageRemove removes an image from the docker host.
func (*FakeDockerClient) ServerVersion ¶
func (d *FakeDockerClient) ServerVersion(ctx context.Context) (dockertypes.Version, error)
ServerVersion returns information of the docker client and server host.