Documentation ¶
Overview ¶
Package mock provides functionalities for mocking testcontainers-go.
Index ¶
- Variables
- type Container
- func (_m *Container) ContainerIP(_a0 context.Context) (string, error)
- func (_m *Container) ContainerIPs(_a0 context.Context) ([]string, error)
- func (_m *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, ...) error
- func (_m *Container) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error)
- func (_m *Container) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, ...) error
- func (_m *Container) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, ...) error
- func (_m *Container) Endpoint(_a0 context.Context, _a1 string) (string, error)
- func (_m *Container) Exec(ctx context.Context, cmd []string, options ...exec.ProcessOption) (int, io.Reader, error)
- func (_m *Container) FollowOutput(_a0 testcontainers.LogConsumer)
- func (_m *Container) GetContainerID() string
- func (_m *Container) GetLogProductionErrorChannel() <-chan error
- func (_m *Container) Host(_a0 context.Context) (string, error)
- func (_m *Container) Inspect(_a0 context.Context) (*types.ContainerJSON, error)
- func (_m *Container) IsRunning() bool
- func (_m *Container) Logs(_a0 context.Context) (io.ReadCloser, error)
- func (_m *Container) MappedPort(_a0 context.Context, _a1 nat.Port) (nat.Port, error)
- func (_m *Container) Name(_a0 context.Context) (string, error)
- func (_m *Container) NetworkAliases(_a0 context.Context) (map[string][]string, error)
- func (_m *Container) Networks(_a0 context.Context) ([]string, error)
- func (_m *Container) PortEndpoint(_a0 context.Context, _a1 nat.Port, _a2 string) (string, error)
- func (_m *Container) Ports(_a0 context.Context) (nat.PortMap, error)
- func (_m *Container) SessionID() string
- func (_m *Container) Start(_a0 context.Context) error
- func (_m *Container) StartLogProducer(_a0 context.Context, _a1 ...testcontainers.LogProductionOption) error
- func (_m *Container) State(_a0 context.Context) (*types.ContainerState, error)
- func (_m *Container) Stop(_a0 context.Context, _a1 *time.Duration) error
- func (_m *Container) StopLogProducer() error
- func (_m *Container) Terminate(ctx context.Context) error
- type ContainerMocker
Constants ¶
This section is empty.
Variables ¶
var NopContainer = MockContainer()
NopContainer is no mock Container.
Functions ¶
This section is empty.
Types ¶
type Container ¶
Container is an autogenerated mock type for the Container type
func NewContainer ¶ added in v0.7.0
NewContainer creates a new instance of Container. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*Container) ContainerIP ¶
ContainerIP provides a mock function with given fields: _a0
func (*Container) ContainerIPs ¶ added in v0.7.0
ContainerIPs provides a mock function with given fields: _a0
func (*Container) CopyDirToContainer ¶ added in v0.6.0
func (_m *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, fileMode int64) error
CopyDirToContainer provides a mock function with given fields: ctx, hostDirPath, containerParentPath, fileMode
func (*Container) CopyFileFromContainer ¶
func (_m *Container) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error)
CopyFileFromContainer provides a mock function with given fields: ctx, filePath
func (*Container) CopyFileToContainer ¶
func (_m *Container) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, fileMode int64) error
CopyFileToContainer provides a mock function with given fields: ctx, hostFilePath, containerFilePath, fileMode
func (*Container) CopyToContainer ¶
func (_m *Container) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, fileMode int64) error
CopyToContainer provides a mock function with given fields: ctx, fileContent, containerFilePath, fileMode
func (*Container) Exec ¶
func (_m *Container) Exec(ctx context.Context, cmd []string, options ...exec.ProcessOption) (int, io.Reader, error)
Exec provides a mock function with given fields: ctx, cmd, options
func (*Container) FollowOutput ¶
func (_m *Container) FollowOutput(_a0 testcontainers.LogConsumer)
FollowOutput provides a mock function with given fields: _a0
func (*Container) GetContainerID ¶
GetContainerID provides a mock function with given fields:
func (*Container) GetLogProductionErrorChannel ¶ added in v0.13.0
GetLogProductionErrorChannel provides a mock function with given fields:
func (*Container) Inspect ¶ added in v0.14.0
Inspect provides a mock function with given fields: _a0
func (*Container) MappedPort ¶
MappedPort provides a mock function with given fields: _a0, _a1
func (*Container) NetworkAliases ¶
NetworkAliases provides a mock function with given fields: _a0
func (*Container) PortEndpoint ¶
PortEndpoint provides a mock function with given fields: _a0, _a1, _a2
func (*Container) StartLogProducer ¶
func (_m *Container) StartLogProducer(_a0 context.Context, _a1 ...testcontainers.LogProductionOption) error
StartLogProducer provides a mock function with given fields: _a0, _a1
func (*Container) StopLogProducer ¶
StopLogProducer provides a mock function with given fields:
type ContainerMocker ¶
ContainerMocker is Container mocker.
func MockContainer ¶
func MockContainer(mocks ...func(c *Container)) ContainerMocker
MockContainer creates Container mock with cleanup to ensure all the expectations are met. nolint: revive