Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresContainer ¶
type PostgresContainer struct {
Container testcontainers.Container
Host string
Port int
User string
Password string
Database string
}
PostgresContainer holds the testcontainer and connection details
func SetupPostgresContainer ¶
func SetupPostgresContainer(t *testing.T, cfg ...PostgresContainerConfig) *PostgresContainer
SetupPostgresContainer creates and starts a PostgreSQL testcontainer
func (*PostgresContainer) DSN ¶
func (pc *PostgresContainer) DSN() string
DSN returns the PostgreSQL connection string
func (*PostgresContainer) Terminate ¶
func (pc *PostgresContainer) Terminate() error
Terminate stops and removes the container
func (*PostgresContainer) ToPgxConfig ¶
func (pc *PostgresContainer) ToPgxConfig() map[string]interface{}
ToPgxConfig returns configuration compatible with go-kit/pgx.Config
type PostgresContainerConfig ¶
PostgresContainerConfig holds configuration for PostgreSQL container
func DefaultPostgresConfig ¶
func DefaultPostgresConfig() PostgresContainerConfig
DefaultPostgresConfig returns default configuration for PostgreSQL container
Click to show internal directories.
Click to hide internal directories.