Versions in this module Expand all Collapse all v0 v0.9.2 Dec 23, 2020 v0.9.1 Dec 23, 2020 Changes in this version + const Bridge + const ReaperDefault + const ReaperDefaultImage + const StderrLog + const StdoutLog + const TestcontainerLabel + const TestcontainerLabelIsReaper + const TestcontainerLabelSessionID + func SkipIfProviderIsNotHealthy(t *testing.T) + type Container interface + ContainerIP func(context.Context) (string, error) + CopyFileToContainer func(ctx context.Context, hostFilePath string, 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 + StopLogProducer func() error + Terminate func(context.Context) error + func GenericContainer(ctx context.Context, req GenericContainerRequest) (Container, error) + 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 + BindMounts map[string]string + Cmd []string + Entrypoint []string + Env map[string]string + ExposedPorts []string + Hostname string + Image string + Labels map[string]string + Name string + NetworkAliases map[string][]string + NetworkMode container.NetworkMode + Networks []string + Privileged bool + ReaperImage string + RegistryCred string + SkipReaper bool + Tmpfs map[string]string + VolumeMounts map[string]string + WaitingFor wait.Strategy + func (c *ContainerRequest) GetContext() (io.Reader, error) + func (c *ContainerRequest) GetDockerfile() string + func (c *ContainerRequest) ShouldBuildImage() 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 DockerCompose interface + Down func() ExecError + Invoke func() ExecError + WithCommand func([]string) DockerCompose + WithEnv func(map[string]string) DockerCompose + type DockerContainer struct + ID string + Image string + WaitingFor wait.Strategy + func (c *DockerContainer) ContainerIP(ctx context.Context) (string, error) + func (c *DockerContainer) CopyFileToContainer(ctx context.Context, hostFilePath string, 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) 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() (*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 ExecError struct + Command []string + Error error + Stderr error + Stdout error + type FromDockerfile struct + Context string + ContextArchive io.Reader + Dockerfile string + type GenericContainerRequest struct + ProviderType ProviderType + Started bool + type GenericNetworkRequest struct + ProviderType ProviderType + type GenericProvider interface + type ImageBuildInfo interface + GetContext func() (io.Reader, error) + GetDockerfile func() string + ShouldBuildImage func() bool + type LocalDockerCompose struct + Cmd []string + ComposeFilePaths []string + Env map[string]string + Executable string + Identifier string + Services map[string]interface{} + func NewLocalDockerCompose(filePaths []string, identifier string) *LocalDockerCompose + func (dc *LocalDockerCompose) Down() ExecError + func (dc *LocalDockerCompose) Invoke() ExecError + func (dc *LocalDockerCompose) WithCommand(cmd []string) DockerCompose + func (dc *LocalDockerCompose) WithEnv(env map[string]string) DockerCompose + type Log struct + Content []byte + LogType string + type LogConsumer interface + Accept func(Log) + 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() (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)