Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PgContainerOpts ¶
type PgContainerOpts struct { ContainerImage string DbName string DbUser string DbPass string InitScripts []string ConfigFile string }
PgContainerOpts contains the options for creating a PostgreSQL test container.
type PgOptFunc ¶
type PgOptFunc func(*PgContainerOpts)
PgOptFunc is a function that modifies PgContainerOpts.
func WithPgConfigFile ¶
func WithPgContainerImage ¶
func WithPgDbName ¶
func WithPgDbPassword ¶
func WithPgDbUser ¶
func WithPgInitScripts ¶
type TestPgContainer ¶
type TestPgContainer struct {
// contains filtered or unexported fields
}
TestPgContainer wraps a PostgreSQL test container and provides helper methods.
func InitPgTestContainer ¶
func InitPgTestContainer(ctx context.Context, opts ...PgOptFunc) (*TestPgContainer, error)
InitPgTestContainer initializes a new PostgreSQL test container with customizable options. It accepts a variadic list of PgOptFunc to modify the default options.
func (*TestPgContainer) GetConnection ¶
GetConnection returns an active database connection to the PostgreSQL container. It ensures that the connection is established only once, even if called concurrently.
Click to show internal directories.
Click to hide internal directories.