Documentation
¶
Overview ¶
Package container provides a wrapper around the testcontainers-go library to simplify container management in tests.
Index ¶
Constants ¶
View Source
const ( ErrCreateWithModule = strerr.Error("failed to create container with testcontainers module") ErrCreateWithGenericContainer = strerr.Error("failed to create generic container") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) Container ¶ added in v0.2.0
func (c *Container) Container() testcontainers.Container
Container returns the underlying testcontainers.Container.
type Opt ¶
func WithGenericContainer ¶
func WithGenericContainer(req testcontainers.GenericContainerRequest) Opt
WithGenericContainer creates a container using the testcontainers.GenericContainer function.
func WithModule ¶
func WithModule[T testcontainers.Container]( runFn func(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (T, error), img string, opts ...testcontainers.ContainerCustomizer, ) Opt
WithModule creates a container using the testcontainers-go modules.
func WithReadyFn ¶
func WithReadyFn(fn func(testcontainers.Container) error) Opt
WithReadyFn sets a custom readiness function which should block until ready.
Click to show internal directories.
Click to hide internal directories.