Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainDbName     = "main-db"
	MainDbUser     = "postgres"
	MainDbPassword = "password"
)
View Source
const TestSnapshotId = "test-snapshot"

Variables

This section is empty.

Functions

func SetupDatabaseConnection

func SetupDatabaseConnection(ctx context.Context, containers ...*PostgresContainer) *dbx.ShardManager

SetupDatabaseConnection - Setup Database configuration for tests.

Types

type PostgresContainer

type PostgresContainer struct {
	Container      *postgres.PostgresContainer
	MappedPort     nat.Port
	Host           string
	DbName         string
	DbUser         string
	DbPassword     string
	DbShard        dbx.DbShard
	PrepStatements []dbx.PreparedStatement
}

PostgresContainer represents the postgres Container type used in the module.

func StartPostgresContainer

func StartPostgresContainer(ctx context.Context, t *testing.T, preparesStatements []dbx.PreparedStatement) *PostgresContainer

StartPostgresContainer - startContainer creates an instance of the pubsub Container type.

func StartPostgresContainerWithInitScript

func StartPostgresContainerWithInitScript(ctx context.Context, t *testing.T, initScriptPath string, preparesStatements []dbx.PreparedStatement) *PostgresContainer

func (*PostgresContainer) StopContainer

func (c *PostgresContainer) StopContainer(ctx context.Context, t *testing.T) error

Jump to

Keyboard shortcuts

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