gopherstack

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package gopherstack provides a Testcontainers module for Gopherstack.

It lets Go test suites spin up a real Gopherstack container (all AWS mock services on a single HTTP port) with a single call:

container, err := gopherstack.Run(ctx, "ghcr.io/blackbirdworks/gopherstack:latest")
url, err := container.BaseURL(ctx)
// url == "http://localhost:<mapped-port>"

All AWS SDK v2 clients can then be pointed at url without any other credential or region configuration changes.

Index

Constants

View Source
const (
	// DefaultImage is the pre-built Gopherstack Docker image published to GHCR.
	DefaultImage = "ghcr.io/blackbirdworks/gopherstack:latest"
)

Variables

This section is empty.

Functions

func WithEnv

WithEnv returns a ContainerCustomizer that sets environment variables on the container. Keys and values are passed directly to Gopherstack, which exposes them as the usual AWS_* and service-specific variables.

Types

type Container

type Container struct {
	testcontainers.Container
}

Container wraps testcontainers.Container and adds Gopherstack helpers.

func Run

Run starts a Gopherstack container using the provided Docker image and waits until the service is ready. The caller is responsible for terminating the container after use.

container, err := gopherstack.Run(ctx, gopherstack.DefaultImage)
defer testcontainers.TerminateContainer(container)

func (*Container) BaseURL

func (c *Container) BaseURL(ctx context.Context) (string, error)

BaseURL returns the HTTP URL that AWS SDK clients should use as their endpoint override (e.g. "http://localhost:32768").

Jump to

Keyboard shortcuts

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