testcontainers

package
v0.0.0-...-1fafc1f Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresConfig

type PostgresConfig struct {
	Database string
	Username string
	Password string
	Image    string
}

PostgresConfig holds PostgreSQL container configuration

type PostgresContainer

type PostgresContainer struct {
	*docker.DockerContainer
	// contains filtered or unexported fields
}

PostgresContainer wraps a PostgreSQL container for testing

func NewPostgresContainer

func NewPostgresContainer() *PostgresContainer

NewPostgresContainer creates a new PostgreSQL container with default configuration

func NewPostgresContainerWithConfig

func NewPostgresContainerWithConfig(config *PostgresConfig) *PostgresContainer

NewPostgresContainerWithConfig creates a new PostgreSQL container with custom configuration

func (*PostgresContainer) ConnectionString

func (p *PostgresContainer) ConnectionString() string

ConnectionString returns the PostgreSQL connection string

func (*PostgresContainer) Database

func (p *PostgresContainer) Database() string

Database returns the database name

func (*PostgresContainer) Password

func (p *PostgresContainer) Password() string

Password returns the password

func (*PostgresContainer) Start

func (p *PostgresContainer) Start(ctx context.Context) error

Start starts the PostgreSQL container

func (*PostgresContainer) Username

func (p *PostgresContainer) Username() string

Username returns the username

type RedisConfig

type RedisConfig struct {
	Password string
	Image    string
}

RedisConfig holds Redis container configuration

type RedisContainer

type RedisContainer struct {
	*docker.DockerContainer
	// contains filtered or unexported fields
}

RedisContainer wraps a Redis container for testing

func NewRedisContainer

func NewRedisContainer() *RedisContainer

NewRedisContainer creates a new Redis container with default configuration

func NewRedisContainerWithConfig

func NewRedisContainerWithConfig(config *RedisConfig) *RedisContainer

NewRedisContainerWithConfig creates a new Redis container with custom configuration

func (*RedisContainer) ConnectionString

func (r *RedisContainer) ConnectionString() string

ConnectionString returns the Redis connection string

func (*RedisContainer) Password

func (r *RedisContainer) Password() string

Password returns the password

func (*RedisContainer) Start

func (r *RedisContainer) Start(ctx context.Context) error

Start starts the Redis container

type TestcontainerAppContainer

type TestcontainerAppContainer struct {
	*docker.DockerContainer
	// contains filtered or unexported fields
}

TestcontainerAppContainer extends DockerContainer with skeleton-specific functionality

func NewTestcontainerAppContainer

func NewTestcontainerAppContainer(config *docker.ContainerConfig, skeletonConfig *container.SkeletonConfig) *TestcontainerAppContainer

NewTestcontainerAppContainer creates a new TestcontainerAppContainer

func (*TestcontainerAppContainer) AddDependency

func (t *TestcontainerAppContainer) AddDependency(dep container.Container)

AddDependency adds a container dependency

func (*TestcontainerAppContainer) ConnectionString

func (t *TestcontainerAppContainer) ConnectionString() string

ConnectionString returns a connection string for the container

func (*TestcontainerAppContainer) Dependencies

func (t *TestcontainerAppContainer) Dependencies() []container.Container

Dependencies returns the container dependencies

func (*TestcontainerAppContainer) HealthEndpoint

func (t *TestcontainerAppContainer) HealthEndpoint() string

HealthEndpoint returns the health check endpoint URL

func (*TestcontainerAppContainer) MetricsEndpoint

func (t *TestcontainerAppContainer) MetricsEndpoint() string

MetricsEndpoint returns the metrics endpoint URL

func (*TestcontainerAppContainer) ShutdownEndpoint

func (t *TestcontainerAppContainer) ShutdownEndpoint() string

func (*TestcontainerAppContainer) SkeletonConfig

func (t *TestcontainerAppContainer) SkeletonConfig() *container.SkeletonConfig

SkeletonConfig returns the skeleton configuration

func (*TestcontainerAppContainer) Start

Start starts the container and its dependencies

func (*TestcontainerAppContainer) Stop

Stop stops the container

func (*TestcontainerAppContainer) WaitForReady

func (t *TestcontainerAppContainer) WaitForReady(ctx context.Context, timeout time.Duration) error

WaitForReady waits for the container and its dependencies to be ready

Jump to

Keyboard shortcuts

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