Documentation
¶
Index ¶
- Constants
- Variables
- func New(p RequestParams) (*testcontainers.GenericContainerRequest, error)
- func WithExtraDatabase(databaseName, username, password string) testcontainers.CustomizeRequestOption
- func WithMigration(fn migration) testcontainers.CustomizeRequestOption
- type ContainerParams
- type RequestParams
- type Result
Constants ¶
View Source
const ( Tag = "postgres" Image = "postgres" Port = "5432/tcp" ContainerPrettyName = "Postgres" )
Variables ¶
View Source
var ( WithUsername = postgres.WithUsername WithPassword = postgres.WithPassword WithDatabase = postgres.WithDatabase )
View Source
var Module = mockestra.BuildContainerModule( Tag, fx.Provide( fx.Annotate( New, fx.ResultTags(`name:"postgres"`), ), Actualize, ), )
View Source
var WithPostReadyHook = mockestra.WithPostReadyHook
Functions ¶
func New ¶
func New(p RequestParams) (*testcontainers.GenericContainerRequest, error)
New is a constructor that returns a testcontainers.GenericContainerRequest and takes its group tagged testcontainers.ContainerCustomizer as options. it is part of tri-phase process with Actualize and Run to create a testcontainers.Container.
func WithExtraDatabase ¶
func WithExtraDatabase(databaseName, username, password string) testcontainers.CustomizeRequestOption
func WithMigration ¶
func WithMigration(fn migration) testcontainers.CustomizeRequestOption
Types ¶
type ContainerParams ¶
type RequestParams ¶
type Result ¶
type Result struct {
fx.Out
Container testcontainers.Container `name:"postgres"`
ContainerGroup testcontainers.Container `group:"containers"`
}
func Actualize ¶
func Actualize(p ContainerParams) (Result, error)
Actualize is a constructor that returns a testcontainers.Container it consumes previously instantiated testcontainers.GenericContainerRequest as part of its inputs, alongside with other tag specified testcontainers.GenericContainerRequest in order to reconcile its lifecycle dependencies before creating a testcontainers.Container.
Click to show internal directories.
Click to hide internal directories.