harness

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package harness provides reusable scaffolding for the pgoutbox e2e tests. It exposes helpers for spinning up real backing services (currently postgres) inside testcontainers.

Index

Constants

View Source
const DefaultPostgresVersion = "18-alpine"

DefaultPostgresVersion is the postgres image tag used when callers do not pin a version explicitly.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context) (string, func(), error)

Start boots a postgres container with default settings. The returned cleanup function terminates the container; callers are responsible for invoking it.

func StartWith

func StartWith(ctx context.Context, opts PostgresOptions) (string, func(), error)

StartWith boots a postgres container using the supplied options and returns its connection string (with sslmode=disable) along with a cleanup function.

Types

type PostgresOptions

type PostgresOptions struct {
	// Version is the postgres image tag (e.g. "16-alpine"). Defaults to
	// DefaultPostgresVersion when empty.
	Version string
	// Database, Username, Password control the credentials seeded into the
	// container. Defaults match the testcontainers-go postgres module.
	Database string
	Username string
	Password string
}

PostgresOptions configures the postgres container started by Start.

Jump to

Keyboard shortcuts

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