Documentation
¶
Overview ¶
Package dockerutils is a generated GoMock package.
Index ¶
- type Container
- type DockerUtils
- type DockerUtilsImpl
- func (du *DockerUtilsImpl) Close() error
- func (du *DockerUtilsImpl) CopyBetweenContainers(srcContainer, destContainer *Container, srcPath, dstPath string) error
- func (du *DockerUtilsImpl) CopyFrom(c *Container, srcPath, dstPath string) error
- func (du *DockerUtilsImpl) CopyTo(c *Container, srcPath, dstPath string) error
- func (du *DockerUtilsImpl) CreateContainer(image string) (*Container, error)
- func (du *DockerUtilsImpl) Exec(c *Container, cmd string) (stdout, stderr string, exitcode int, err error)
- type MockDockerUtils
- func (m *MockDockerUtils) Close() error
- func (m *MockDockerUtils) CopyBetweenContainers(srcContainer, destContainer *Container, srcPath, dstPath string) error
- func (m *MockDockerUtils) CopyFrom(c *Container, srcPath, dstPath string) error
- func (m *MockDockerUtils) CopyTo(c *Container, srcPath, dstPath string) error
- func (m *MockDockerUtils) CreateContainer(image string) (*Container, error)
- func (m *MockDockerUtils) EXPECT() *MockDockerUtilsMockRecorder
- func (m *MockDockerUtils) Exec(c *Container, cmd string) (string, string, int, error)
- type MockDockerUtilsMockRecorder
- func (mr *MockDockerUtilsMockRecorder) Close() *gomock.Call
- func (mr *MockDockerUtilsMockRecorder) CopyBetweenContainers(srcContainer, destContainer, srcPath, dstPath any) *gomock.Call
- func (mr *MockDockerUtilsMockRecorder) CopyFrom(c, srcPath, dstPath any) *gomock.Call
- func (mr *MockDockerUtilsMockRecorder) CopyTo(c, srcPath, dstPath any) *gomock.Call
- func (mr *MockDockerUtilsMockRecorder) CreateContainer(image any) *gomock.Call
- func (mr *MockDockerUtilsMockRecorder) Exec(c, cmd any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
type DockerUtils ¶
type DockerUtils interface { Close() error CreateContainer(image string) (*Container, error) Exec(c *Container, cmd string) (stdout, stderr string, exitcode int, err error) CopyTo(c *Container, srcPath, dstPath string) error CopyFrom(c *Container, srcPath, dstPath string) error CopyBetweenContainers(srcContainer, destContainer *Container, srcPath, dstPath string) error }
type DockerUtilsImpl ¶ added in v0.4.0
type DockerUtilsImpl struct {
// contains filtered or unexported fields
}
func New ¶
initializes a DockerUtils client - make sure to defer a call to Close() the client on exit
func NewWithClient ¶
func NewWithClient(logger *slog.Logger, cli wrapper.DockerClient) *DockerUtilsImpl
initialize a DockerUtils client while providing a pre-created Docker client
func (*DockerUtilsImpl) Close ¶ added in v0.4.0
func (du *DockerUtilsImpl) Close() error
closes the DockerUtils client, and removes all containers created by the client during program execution
func (*DockerUtilsImpl) CopyBetweenContainers ¶ added in v0.4.0
func (du *DockerUtilsImpl) CopyBetweenContainers(srcContainer, destContainer *Container, srcPath, dstPath string) error
copies a file or directory between two containers
func (*DockerUtilsImpl) CopyFrom ¶ added in v0.4.0
func (du *DockerUtilsImpl) CopyFrom(c *Container, srcPath, dstPath string) error
copies a file or directory from a container to the host
func (*DockerUtilsImpl) CopyTo ¶ added in v0.4.0
func (du *DockerUtilsImpl) CopyTo(c *Container, srcPath, dstPath string) error
copies a file or directory from the host to a container
func (*DockerUtilsImpl) CreateContainer ¶ added in v0.4.0
func (du *DockerUtilsImpl) CreateContainer(image string) (*Container, error)
creates a container with the specified image
type MockDockerUtils ¶ added in v0.4.0
type MockDockerUtils struct {
// contains filtered or unexported fields
}
MockDockerUtils is a mock of DockerUtils interface.
func NewMockDockerUtils ¶ added in v0.4.0
func NewMockDockerUtils(ctrl *gomock.Controller) *MockDockerUtils
NewMockDockerUtils creates a new mock instance.
func (*MockDockerUtils) Close ¶ added in v0.4.0
func (m *MockDockerUtils) Close() error
Close mocks base method.
func (*MockDockerUtils) CopyBetweenContainers ¶ added in v0.4.0
func (m *MockDockerUtils) CopyBetweenContainers(srcContainer, destContainer *Container, srcPath, dstPath string) error
CopyBetweenContainers mocks base method.
func (*MockDockerUtils) CopyFrom ¶ added in v0.4.0
func (m *MockDockerUtils) CopyFrom(c *Container, srcPath, dstPath string) error
CopyFrom mocks base method.
func (*MockDockerUtils) CopyTo ¶ added in v0.4.0
func (m *MockDockerUtils) CopyTo(c *Container, srcPath, dstPath string) error
CopyTo mocks base method.
func (*MockDockerUtils) CreateContainer ¶ added in v0.4.0
func (m *MockDockerUtils) CreateContainer(image string) (*Container, error)
CreateContainer mocks base method.
func (*MockDockerUtils) EXPECT ¶ added in v0.4.0
func (m *MockDockerUtils) EXPECT() *MockDockerUtilsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDockerUtilsMockRecorder ¶ added in v0.4.0
type MockDockerUtilsMockRecorder struct {
// contains filtered or unexported fields
}
MockDockerUtilsMockRecorder is the mock recorder for MockDockerUtils.
func (*MockDockerUtilsMockRecorder) Close ¶ added in v0.4.0
func (mr *MockDockerUtilsMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockDockerUtilsMockRecorder) CopyBetweenContainers ¶ added in v0.4.0
func (mr *MockDockerUtilsMockRecorder) CopyBetweenContainers(srcContainer, destContainer, srcPath, dstPath any) *gomock.Call
CopyBetweenContainers indicates an expected call of CopyBetweenContainers.
func (*MockDockerUtilsMockRecorder) CopyFrom ¶ added in v0.4.0
func (mr *MockDockerUtilsMockRecorder) CopyFrom(c, srcPath, dstPath any) *gomock.Call
CopyFrom indicates an expected call of CopyFrom.
func (*MockDockerUtilsMockRecorder) CopyTo ¶ added in v0.4.0
func (mr *MockDockerUtilsMockRecorder) CopyTo(c, srcPath, dstPath any) *gomock.Call
CopyTo indicates an expected call of CopyTo.
func (*MockDockerUtilsMockRecorder) CreateContainer ¶ added in v0.4.0
func (mr *MockDockerUtilsMockRecorder) CreateContainer(image any) *gomock.Call
CreateContainer indicates an expected call of CreateContainer.