testainer

package module
v0.0.0-...-f1d8d17 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-testainer

Archived. This was a project that essentially did the same thing that Testcontainers do and is no longer necessary.

Documentation

Index

Constants

View Source
const (
	// The dockerhub registry, this is used by default in the cli but must
	// be done explicitly when programmatically used with the daemon.
	DockerHubLibraryRegistry = `registry.hub.docker.com/library`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackFunc

type CallbackFunc[ContainerT any] func(ctx context.Context, details *ContainerT) error

type CleanupFunc

type CleanupFunc func() error

type Config

type Config struct {
	Registry string
	Image    string
	Tag      string
	Port     int
	Env      map[string]string
}

Congfiguration to start the image with

type ContainerDetails

type ContainerDetails struct {
	Port int
}

Generic information about the created container

type Testainer

type Testainer[ConfigT, ContainerT any] interface {
	Use(ctx context.Context, config ConfigT, callback CallbackFunc[ContainerT]) error
	Run(ctx context.Context, config ConfigT) (*ContainerT, CleanupFunc, error)
}

func New

func New[ConfigT, ContainerT any](toConfig common.MapFunc[ConfigT, Config], fromContainerDetails common.MapFunc[ContainerDetails, ContainerT]) (Testainer[ConfigT, ContainerT], error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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