test

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeConn added in v1.1.3

type FakeConn struct {
}

FakeConn fakes a net.Conn

func (FakeConn) Close added in v1.1.3

func (c FakeConn) Close() error

Close closes the connection

func (FakeConn) LocalAddr added in v1.1.3

func (c FakeConn) LocalAddr() net.Addr

LocalAddr returns the local address

func (FakeConn) Read added in v1.1.3

func (c FakeConn) Read(b []byte) (n int, err error)

Read reads bytes

func (FakeConn) RemoteAddr added in v1.1.3

func (c FakeConn) RemoteAddr() net.Addr

RemoteAddr returns the remote address

func (FakeConn) SetDeadline added in v1.1.3

func (c FakeConn) SetDeadline(t time.Time) error

SetDeadline sets the deadline

func (FakeConn) SetReadDeadline added in v1.1.3

func (c FakeConn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read deadline

func (FakeConn) SetWriteDeadline added in v1.1.3

func (c FakeConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the write deadline

func (FakeConn) Write added in v1.1.3

func (c FakeConn) Write(b []byte) (n int, err error)

Write writes bytes

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 mobyClient.ContainerInspectResult

	ContainerCommitID       string
	ContainerCommitOptions  mobyClient.ContainerCommitOptions
	ContainerCommitResponse mobyClient.ContainerCommitResult
	ContainerCommitErr      error

	BuildImageOpts mobyClient.ImageBuildOptions
	BuildImageErr  error
	Images         map[string]mobyClient.ImageInspectResult

	Containers map[string]mobyContainer.Config

	PullFail error

	Calls []string
}

FakeDockerClient provides a Fake client for Docker testing

func NewFakeDockerClient added in v1.1.3

func NewFakeDockerClient() *FakeDockerClient

NewFakeDockerClient returns a new FakeDockerClient

func (*FakeDockerClient) ContainerAttach added in v1.1.2

ContainerAttach attaches a connection to a container in the server.

func (*FakeDockerClient) ContainerCommit added in v1.1.2

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

func (*FakeDockerClient) ContainerCreate added in v1.1.3

ContainerCreate creates a new container based in the given configuration.

func (*FakeDockerClient) ContainerInspect added in v1.1.3

ContainerInspect returns the container information.

func (*FakeDockerClient) ContainerKill added in v1.1.5

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

func (*FakeDockerClient) ContainerRemove added in v1.1.3

ContainerRemove kills and removes a container from the docker host.

func (*FakeDockerClient) ContainerStart added in v1.1.3

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

func (*FakeDockerClient) ContainerWait added in v1.1.2

ContainerWait pauses execution until a container exits.

func (*FakeDockerClient) CopyFromContainer

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 added in v1.1.2

CopyToContainer copies content into the container filesystem.

func (*FakeDockerClient) ImageBuild added in v1.1.2

ImageBuild sends request to the daemon to build images.

func (*FakeDockerClient) ImageInspect added in v1.6.1

ImageInspectWithRaw returns the image information and its raw representation.

func (*FakeDockerClient) ImagePull added in v1.1.3

ImagePull requests the docker host to pull an image from a remote registry.

func (*FakeDockerClient) ImageRemove added in v1.1.3

ImageRemove removes an image from the docker host.

func (*FakeDockerClient) ServerVersion added in v1.1.3

ServerVersion returns information of the docker client and server host.

Jump to

Keyboard shortcuts

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