Documentation ¶
Overview ¶
Package mock provides functionalities for mocking testcontainers-go.
Index ¶
- Variables
- type Container
- func (c *Container) ContainerIP(ctx context.Context) (string, error)
- func (c *Container) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error)
- func (c *Container) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, ...) error
- func (c *Container) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, ...) error
- func (c *Container) Endpoint(ctx context.Context, proto string) (string, error)
- func (c *Container) Exec(ctx context.Context, cmd []string) (int, error)
- func (c *Container) FollowOutput(consumer testcontainers.LogConsumer)
- func (c *Container) GetContainerID() string
- func (c *Container) Host(ctx context.Context) (string, error)
- func (c *Container) Logs(ctx context.Context) (io.ReadCloser, error)
- func (c *Container) MappedPort(ctx context.Context, port nat.Port) (nat.Port, error)
- func (c *Container) Name(ctx context.Context) (string, error)
- func (c *Container) NetworkAliases(ctx context.Context) (map[string][]string, error)
- func (c *Container) Networks(ctx context.Context) ([]string, error)
- func (c *Container) PortEndpoint(ctx context.Context, port nat.Port, proto string) (string, error)
- func (c *Container) Ports(ctx context.Context) (nat.PortMap, error)
- func (c *Container) SessionID() string
- func (c *Container) Start(ctx context.Context) error
- func (c *Container) StartLogProducer(ctx context.Context) error
- func (c *Container) State(ctx context.Context) (*types.ContainerState, error)
- func (c *Container) Stop(ctx context.Context, duration *time.Duration) error
- func (c *Container) StopLogProducer() error
- func (c *Container) Terminate(ctx context.Context) error
- type ContainerMocker
Constants ¶
This section is empty.
Variables ¶
var NoMockContainer = MockContainer()
NoMockContainer is no mock Container.
Functions ¶
This section is empty.
Types ¶
type Container ¶
Container is a testcontainers.Container.
func (*Container) ContainerIP ¶
ContainerIP satisfies testcontainers.Container interface.
func (*Container) CopyFileFromContainer ¶
func (c *Container) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error)
CopyFileFromContainer satisfies testcontainers.Container interface.
func (*Container) CopyFileToContainer ¶
func (c *Container) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, fileMode int64) error
CopyFileToContainer satisfies testcontainers.Container interface.
func (*Container) CopyToContainer ¶
func (c *Container) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, fileMode int64) error
CopyToContainer satisfies testcontainers.Container interface.
func (*Container) FollowOutput ¶
func (c *Container) FollowOutput(consumer testcontainers.LogConsumer)
FollowOutput satisfies testcontainers.Container interface.
func (*Container) GetContainerID ¶
GetContainerID satisfies testcontainers.Container interface.
func (*Container) MappedPort ¶
MappedPort satisfies testcontainers.Container interface.
func (*Container) NetworkAliases ¶
NetworkAliases satisfies testcontainers.Container interface.
func (*Container) PortEndpoint ¶
PortEndpoint satisfies testcontainers.Container interface.
func (*Container) StartLogProducer ¶
StartLogProducer satisfies testcontainers.Container interface.
func (*Container) StopLogProducer ¶
StopLogProducer satisfies testcontainers.Container interface.
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