go-tstr / tstr / dep / container

github.com/go-tstr/tstr/dep/container

pkg.go.dev source
go get github.com/go-tstr/tstr/dep/container@v0.0.2

Constants

const (
	ErrCreateWithModule           = strerr.Error("failed to create container with testcontainers module")
	ErrCreateWithGenericContainer = strerr.Error("failed to create generic container")
)

Types

type Container

type Container struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Opt) *Container

func (*Container) Ready

func (c *Container) Ready() error

func (*Container) Start

func (c *Container) Start() error

func (*Container) Stop

func (c *Container) Stop() error

type Opt

type Opt func(*Container) error

func WithGenericContainer

func WithGenericContainer(req testcontainers.GenericContainerRequest) Opt

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

func WithReadyFn

func WithReadyFn(fn func(testcontainers.Container) error) Opt