testainer

package module
v0.0.0-...-8d48b28 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

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