Versions in this module Expand all Collapse all v1 v1.0.0 Nov 9, 2025 Changes in this version + var ErrContainerPortConflict = errors.New("container port conflict detected") + var ErrContainerStartTimeout = errors.New("container failed to start within timeout period") + var ErrDatabaseConnFailed = errors.New("failed to connect to container database") + var ErrDockerNotAvailable = errors.New("Docker is not available or running") + var ErrMigrationsFailed = errors.New("database migrations failed") + func FindMigrationsPath() string + func SkipIfDockerUnavailable() (shouldSkip bool, skipMessage string) + type DockerAvailabilityResult struct + Available bool + Error error + Reason string + func CheckDockerAvailability() DockerAvailabilityResult + type PostgreSQLConfig struct + DatabaseName string + MaxConnIdle time.Duration + MaxConnLife time.Duration + MaxConns int32 + MigrationsPath string + MinConns int32 + Password string + PostgreSQLVersion string + RunMigrations bool + StartupTimeout time.Duration + Username string + func DefaultPostgreSQLConfig() *PostgreSQLConfig + type PostgreSQLTestContainer struct + Container *postgres.PostgresContainer + Context context.Context + DatabaseName string + DatabaseURL string + Password string + Pool *pgxpool.Pool + Username string + func StartPostgreSQLContainer(ctx context.Context, config *PostgreSQLConfig) (*PostgreSQLTestContainer, error) + func StartPostgreSQLContainerWithCheck(ctx context.Context, config *PostgreSQLConfig) (*PostgreSQLTestContainer, error) + func StartPostgreSQLContainerWithMigrations(ctx context.Context, migrationsPath string) (*PostgreSQLTestContainer, error) + func StartSimplePostgreSQLContainer(ctx context.Context) (*PostgreSQLTestContainer, error) + func (tc *PostgreSQLTestContainer) CleanAllTables(ctx context.Context) error + func (tc *PostgreSQLTestContainer) CleanSpecificTables(ctx context.Context, tableNames ...string) error + func (tc *PostgreSQLTestContainer) Close() error + func (tc *PostgreSQLTestContainer) GetConnectionString() string + func (tc *PostgreSQLTestContainer) GetContainer() *postgres.PostgresContainer + func (tc *PostgreSQLTestContainer) GetPool() *pgxpool.Pool + func (tc *PostgreSQLTestContainer) NewTestDatabase(dbName string) (string, error) + func (tc *PostgreSQLTestContainer) WithCleanup() func() + func (tc *PostgreSQLTestContainer) WithTableCleanup(tables ...string) func()