testcontainers

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupElasticsearchContainer

func SetupElasticsearchContainer(ctx context.Context, url *string) (cleanup, error)

func SetupKafkaContainer

func SetupKafkaContainer(ctx context.Context, brokers *[]string) (cleanup, error)

func SetupOpenSearchContainer

func SetupOpenSearchContainer(ctx context.Context, url *string) (cleanup, error)

func SetupPostgresContainer

func SetupPostgresContainer(ctx context.Context, url *string, image PostgresImage, configFile ...string) (cleanup, error)

func SetupPostgresPrimaryReplica added in v1.3.0

func SetupPostgresPrimaryReplica(ctx context.Context, primaryURL, replicaURL *string) (cleanup, error)

SetupPostgresPrimaryReplica starts a Postgres primary together with a physical streaming replica of it, on a shared docker network, and writes their connection strings to primaryURL and replicaURL.

Both run Postgres 17 with wal2json, built from testdata/pg-wal2json. That combination is required and not otherwise available in this repo: logical decoding on a standby needs Postgres 16+, while the debezium/postgres images used by the rest of the suite only ship wal2json up to their 14 tag.

The returned cleanup tears down both containers and the network.

Types

type PostgresImage

type PostgresImage string
const (
	Postgres14         PostgresImage = "debezium/postgres:14-alpine"
	Postgres17         PostgresImage = "debezium/postgres:17-alpine"
	PgvectorPostgres17 PostgresImage = "pgvector/pgvector:pg17"
)

Jump to

Keyboard shortcuts

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