dockertestutil

package
v0.23.0-beta3.patch5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: BSD-3-Clause Imports: 11 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.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDockertestCommandFailed  = errors.New("dockertest command failed")
	ErrDockertestCommandTimeout = errors.New("dockertest command timed out")
)
View Source
var ErrContainerNotFound = errors.New("container not found")

Functions

func AddContainerToNetwork

func AddContainerToNetwork(
	pool *dockertest.Pool,
	network *dockertest.Network,
	testContainer string,
) error

func DockerAllowLocalIPv6

func DockerAllowLocalIPv6(config *docker.HostConfig)

func DockerAllowNetworkAdministration

func DockerAllowNetworkAdministration(config *docker.HostConfig)

func DockerRestartPolicy

func DockerRestartPolicy(config *docker.HostConfig)

func ExecuteCommand

func ExecuteCommand(
	resource *dockertest.Resource,
	cmd []string,
	env []string,
	options ...ExecuteCommandOption,
) (string, string, error)

func GetFirstOrCreateNetwork

func GetFirstOrCreateNetwork(pool *dockertest.Pool, name string) (*dockertest.Network, error)

func IsRunningInContainer

func IsRunningInContainer() bool

func RandomFreeHostPort

func RandomFreeHostPort() (int, error)

RandomFreeHostPort asks the kernel for a free open port that is ready to use. (from https://github.com/phayes/freeport)

func SaveLog

func SaveLog(
	pool *dockertest.Pool,
	resource *dockertest.Resource,
	basePath string,
) error

Types

type ExecuteCommandConfig

type ExecuteCommandConfig struct {
	// contains filtered or unexported fields
}

type ExecuteCommandOption

type ExecuteCommandOption func(*ExecuteCommandConfig) error

func ExecuteCommandTimeout

func ExecuteCommandTimeout(timeout time.Duration) ExecuteCommandOption

Jump to

Keyboard shortcuts

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