testutil

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestDBUser     = "testuser"
	TestDBPassword = "testpass"
	TestDBName     = "testdb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresContainer

type PostgresContainer struct {
	Container *postgres.PostgresContainer
	Host      string
	Port      int
}

PostgresContainer wraps a testcontainers Postgres instance.

func StartPostgres

func StartPostgres(ctx context.Context, t *testing.T) *PostgresContainer

StartPostgres spins up a Postgres container for integration tests.

func (*PostgresContainer) ConnectionString

func (pc *PostgresContainer) ConnectionString(database string) string

ConnectionString returns a DSN for connecting to the test container.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL