containers

package
v0.0.0-...-951a412 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCommandExecutionTimeout = 15 * time.Second
View Source
var DefaultTestPw = "asd"

Functions

func BuildImage

func BuildImage(ctx context.Context, imageName string, coverage, race bool) (string, error)

func ExecAs

func ExecAs(user vocab.IRI, prv crypto.PrivateKey) admin

func ExtractEnvTagFromBuild

func ExtractEnvTagFromBuild() env.Type

func ExtractStorageTagFromBuild

func ExtractStorageTagFromBuild() storage.Type

func ExtractToken

func ExtractToken(token *c2s.BearerSigner, i []byte) (int, error)

func WithCodeCoveragePath

func WithCodeCoveragePath(hostPath string) tc.CustomizeRequestOption

func WithEnv

func WithEnv(env map[string]string) tc.CustomizeRequestOption

func WithEnvFromConfig

func WithEnvFromConfig(options config.Options) tc.CustomizeRequestOption

func WithIO

func WithIO(in io.ReadWriter) exec.ProcessOption

func WithImage

func WithImage(image string) tc.CustomizeRequestOption

func WithMocks

func WithMocks(items ...vocab.Item) tc.CustomizeRequestOption

func WithPassword

func WithPassword(pw []byte) tc.CustomizeRequestOption

func WithPostgresInitScript

func WithPostgresInitScript() tc.CustomizeRequestOption

func WithStorage

func WithStorage(storage string) tc.CustomizeRequestOption

Types

type ContainerInitializer

type ContainerInitializer interface {
	Name() string
	Start(ctx context.Context, t testing.TB, extra ...tc.ContainerCustomizer) ([]tc.Container, error)
	Hostname() string
}

func Suite

func Suite(container ...ContainerInitializer) []ContainerInitializer

type HasItems

type HasItems interface{ Items() vocab.ItemCollection }

type Running

type Running struct {
	Containers []tc.Container
	Network    *tc.DockerNetwork
}

func Start

func Start(ctx context.Context, t testing.TB, imgs ...ContainerInitializer) (Running, error)

func (*Running) Cleanup

func (m *Running) Cleanup(t testing.TB)

func (*Running) DialContext

func (m *Running) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

func (*Running) RunCommand

func (m *Running) RunCommand(ctx context.Context, host string, cmd tc.Executable, IO io.ReadWriter) (io.Reader, error)

func (*Running) SaveItemsFiles

func (m *Running) SaveItemsFiles(t testing.TB)

type SSHCmd

type SSHCmd struct {
	Cmd  []string
	User string
	Pw   []byte
	IO   io.ReadWriter
	Key  crypto.PrivateKey
}

func (SSHCmd) AsCommand

func (c SSHCmd) AsCommand() []string

func (SSHCmd) Options

func (c SSHCmd) Options() []exec.ProcessOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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