Versions in this module Expand all Collapse all v0 v0.15.0 Mar 31, 2022 v0.13.0 Mar 31, 2022 Changes in this version + const Bridge + const ReaperDefault + const ReaperDefaultImage + const StderrLog + const StdoutLog + const TestcontainerLabel + const TestcontainerLabelIsReaper + const TestcontainerLabelSessionID + var ErrDuplicateMountTarget = errors.New("duplicate mount target detected") + func SkipIfProviderIsNotHealthy(t *testing.T) + type BindMounter interface + GetBindOptions func() *mount.BindOptions + type Container interface + ContainerIP func(context.Context) (string, error) + CopyFileFromContainer func(ctx context.Context, filePath string) (io.ReadCloser, error) + CopyFileToContainer func(ctx context.Context, hostFilePath string, containerFilePath string, ...) error + CopyToContainer func(ctx context.Context, fileContent []byte, containerFilePath string, ...) error + Endpoint func(context.Context, string) (string, error) + Exec func(ctx context.Context, cmd []string) (int, error) + FollowOutput func(LogConsumer) + GetContainerID func() string + Host func(context.Context) (string, error) + Logs func(context.Context) (io.ReadCloser, error) + MappedPort func(context.Context, nat.Port) (nat.Port, error) + Name func(context.Context) (string, error) + NetworkAliases func(context.Context) (map[string][]string, error) + Networks func(context.Context) ([]string, error) + PortEndpoint func(context.Context, nat.Port, string) (string, error) + Ports func(context.Context) (nat.PortMap, error) + SessionID func() string + Start func(context.Context) error + StartLogProducer func(context.Context) error + State func(context.Context) (*types.ContainerState, error) + Stop func(context.Context, *time.Duration) error + StopLogProducer func() error + Terminate func(context.Context) error + func GenericContainer(ctx context.Context, req GenericContainerRequest) (Container, error) + type ContainerMount struct + ReadOnly bool + Source ContainerMountSource + Target ContainerMountTarget + func BindMount(hostPath string, mountTarget ContainerMountTarget) ContainerMount + func VolumeMount(volumeName string, mountTarget ContainerMountTarget) ContainerMount + type ContainerMountSource interface + Source func() string + Type func() MountType + type ContainerMountTarget string + func (t ContainerMountTarget) Target() string + type ContainerMounts []ContainerMount + func Mounts(mounts ...ContainerMount) ContainerMounts + type ContainerProvider interface + CreateContainer func(context.Context, ContainerRequest) (Container, error) + Health func(context.Context) error + RunContainer func(context.Context, ContainerRequest) (Container, error) + type ContainerRequest struct + AlwaysPullImage bool + AutoRemove bool + Cmd []string + Entrypoint []string + Env map[string]string + ExposedPorts []string + ExtraHosts []string + Hostname string + Image string + ImagePlatform string + Labels map[string]string + Mounts ContainerMounts + Name string + NetworkAliases map[string][]string + NetworkMode container.NetworkMode + Networks []string + Privileged bool + ReaperImage string + RegistryCred string + Resources container.Resources + SkipReaper bool + Tmpfs map[string]string + User string + WaitingFor wait.Strategy + func (c *ContainerRequest) GetBuildArgs() map[string]*string + func (c *ContainerRequest) GetContext() (io.Reader, error) + func (c *ContainerRequest) GetDockerfile() string + func (c *ContainerRequest) ShouldBuildImage() bool + func (c *ContainerRequest) ShouldPrintBuildLog() bool + func (c *ContainerRequest) Validate() error + type DeprecatedContainer interface + GetHostEndpoint func(ctx context.Context, port string) (string, string, error) + GetIPAddress func(ctx context.Context) (string, error) + LivenessCheckPorts func(ctx context.Context) (nat.PortSet, error) + Terminate func(ctx context.Context) error + type DockerBindMountSource struct + HostPath string + func (DockerBindMountSource) Type() MountType + func (s DockerBindMountSource) GetBindOptions() *mount.BindOptions + func (s DockerBindMountSource) Source() string + type DockerCompose interface + Down func() ExecError + Invoke func() ExecError + WaitForService func(string, wait.Strategy) DockerCompose + WithCommand func([]string) DockerCompose + WithEnv func(map[string]string) DockerCompose + WithExposedService func(string, int, wait.Strategy) DockerCompose + type DockerContainer struct + ID string + Image string + WaitingFor wait.Strategy + func (c *DockerContainer) ContainerIP(ctx context.Context) (string, error) + func (c *DockerContainer) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error) + func (c *DockerContainer) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, ...) error + func (c *DockerContainer) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, ...) error + func (c *DockerContainer) Endpoint(ctx context.Context, proto string) (string, error) + func (c *DockerContainer) Exec(ctx context.Context, cmd []string) (int, error) + func (c *DockerContainer) FollowOutput(consumer LogConsumer) + func (c *DockerContainer) GetContainerID() string + func (c *DockerContainer) Host(ctx context.Context) (string, error) + func (c *DockerContainer) Logs(ctx context.Context) (io.ReadCloser, error) + func (c *DockerContainer) MappedPort(ctx context.Context, port nat.Port) (nat.Port, error) + func (c *DockerContainer) Name(ctx context.Context) (string, error) + func (c *DockerContainer) NetworkAliases(ctx context.Context) (map[string][]string, error) + func (c *DockerContainer) Networks(ctx context.Context) ([]string, error) + func (c *DockerContainer) PortEndpoint(ctx context.Context, port nat.Port, proto string) (string, error) + func (c *DockerContainer) Ports(ctx context.Context) (nat.PortMap, error) + func (c *DockerContainer) SessionID() string + func (c *DockerContainer) Start(ctx context.Context) error + func (c *DockerContainer) StartLogProducer(ctx context.Context) error + func (c *DockerContainer) State(ctx context.Context) (*types.ContainerState, error) + func (c *DockerContainer) Stop(ctx context.Context, timeout *time.Duration) error + func (c *DockerContainer) StopLogProducer() error + func (c *DockerContainer) Terminate(ctx context.Context) error + type DockerNetwork struct + Driver string + ID string + Name string + func (n *DockerNetwork) Remove(ctx context.Context) error + type DockerProvider struct + func NewDockerProvider(provOpts ...DockerProviderOption) (*DockerProvider, error) + func (p *DockerProvider) BuildImage(ctx context.Context, img ImageBuildInfo) (string, error) + func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerRequest) (Container, error) + func (p *DockerProvider) CreateNetwork(ctx context.Context, req NetworkRequest) (Network, error) + func (p *DockerProvider) GetGatewayIP(ctx context.Context) (string, error) + func (p *DockerProvider) GetNetwork(ctx context.Context, req NetworkRequest) (types.NetworkResource, error) + func (p *DockerProvider) Health(ctx context.Context) (err error) + func (p *DockerProvider) RunContainer(ctx context.Context, req ContainerRequest) (Container, error) + type DockerProviderOption interface + ApplyDockerTo func(opts *DockerProviderOptions) + func Generic2DockerOptions(opts ...GenericProviderOption) []DockerProviderOption + type DockerProviderOptionFunc func(opts *DockerProviderOptions) + func (f DockerProviderOptionFunc) ApplyDockerTo(opts *DockerProviderOptions) + type DockerProviderOptions struct + type DockerTmpfsMountSource struct + func (s DockerTmpfsMountSource) GetTmpfsOptions() *mount.TmpfsOptions + type DockerVolumeMountSource struct + Name string + func (DockerVolumeMountSource) Type() MountType + func (s DockerVolumeMountSource) GetVolumeOptions() *mount.VolumeOptions + func (s DockerVolumeMountSource) Source() string + type ExecError struct + Command []string + Error error + Stderr error + Stdout error + type FileFromContainer struct + func (fc *FileFromContainer) Close() error + func (fc *FileFromContainer) Read(b []byte) (int, error) + type FromDockerfile struct + BuildArgs map[string]*string + Context string + ContextArchive io.Reader + Dockerfile string + PrintBuildLog bool + type GenericBindMountSource struct + HostPath string + func (GenericBindMountSource) Type() MountType + func (s GenericBindMountSource) Source() string + type GenericContainerRequest struct + Logger Logging + ProviderType ProviderType + Started bool + type GenericNetworkRequest struct + ProviderType ProviderType + type GenericProvider interface + type GenericProviderOption interface + ApplyGenericTo func(opts *GenericProviderOptions) + type GenericProviderOptionFunc func(opts *GenericProviderOptions) + func (f GenericProviderOptionFunc) ApplyGenericTo(opts *GenericProviderOptions) + type GenericProviderOptions struct + Logger Logging + type GenericTmpfsMountSource struct + func (GenericTmpfsMountSource) Type() MountType + func (s GenericTmpfsMountSource) Source() string + type GenericVolumeMountSource struct + Name string + func (GenericVolumeMountSource) Type() MountType + func (s GenericVolumeMountSource) Source() string + type ImageBuildInfo interface + GetBuildArgs func() map[string]*string + GetContext func() (io.Reader, error) + GetDockerfile func() string + ShouldBuildImage func() bool + ShouldPrintBuildLog func() bool + type LocalDockerCompose struct + Cmd []string + ComposeFilePaths []string + Env map[string]string + Executable string + Identifier string + Services map[string]interface{} + WaitStrategyMap map[waitService]wait.Strategy + func NewLocalDockerCompose(filePaths []string, identifier string, opts ...LocalDockerComposeOption) *LocalDockerCompose + func (dc *LocalDockerCompose) Down() ExecError + func (dc *LocalDockerCompose) Invoke() ExecError + func (dc *LocalDockerCompose) WaitForService(service string, strategy wait.Strategy) DockerCompose + func (dc *LocalDockerCompose) WithCommand(cmd []string) DockerCompose + func (dc *LocalDockerCompose) WithEnv(env map[string]string) DockerCompose + func (dc *LocalDockerCompose) WithExposedService(service string, port int, strategy wait.Strategy) DockerCompose + type LocalDockerComposeOption interface + ApplyToLocalCompose func(opts *LocalDockerComposeOptions) + type LocalDockerComposeOptions struct + Logger Logging + type LocalDockerComposeOptionsFunc func(opts *LocalDockerComposeOptions) + func (f LocalDockerComposeOptionsFunc) ApplyToLocalCompose(opts *LocalDockerComposeOptions) + type Log struct + Content []byte + LogType string + type LogConsumer interface + Accept func(Log) + type LoggerOption struct + func WithLogger(logger Logging) LoggerOption + func (o LoggerOption) ApplyDockerTo(opts *DockerProviderOptions) + func (o LoggerOption) ApplyGenericTo(opts *GenericProviderOptions) + func (o LoggerOption) ApplyToLocalCompose(opts *LocalDockerComposeOptions) + type Logging interface + Printf func(format string, v ...interface{}) + var Logger Logging = log.New(os.Stderr, "", log.LstdFlags) + func TestLogger(tb testing.TB) Logging + type MountType uint + const MountTypeBind + const MountTypePipe + const MountTypeTmpfs + const MountTypeVolume + type Network interface + Remove func(context.Context) error + func GenericNetwork(ctx context.Context, req GenericNetworkRequest) (Network, error) + type NetworkProvider interface + CreateNetwork func(context.Context, NetworkRequest) (Network, error) + GetNetwork func(context.Context, NetworkRequest) (types.NetworkResource, error) + type NetworkRequest struct + Attachable bool + CheckDuplicate bool + Driver string + EnableIPv6 bool + Internal bool + Labels map[string]string + Name string + ReaperImage string + SkipReaper bool + type ProviderType int + const ProviderDocker + func (t ProviderType) GetProvider(opts ...GenericProviderOption) (GenericProvider, error) + type Reaper struct + Endpoint string + Provider ReaperProvider + SessionID string + func NewReaper(ctx context.Context, sessionID string, provider ReaperProvider, ...) (*Reaper, error) + func (r *Reaper) Connect() (chan bool, error) + func (r *Reaper) Labels() map[string]string + type ReaperProvider interface + RunContainer func(ctx context.Context, req ContainerRequest) (Container, error) + type TestContainersConfig struct + CertPath string + Host string + TLSVerify int + type TmpfsMounter interface + GetTmpfsOptions func() *mount.TmpfsOptions + type VolumeMounter interface + GetVolumeOptions func() *mount.VolumeOptions