Versions in this module Expand all Collapse all v0 v0.0.2 Sep 14, 2022 Changes in this version + const DefaultPort + var ErrEnvClient = fmt.Errorf("can't connect to docker host") + var ErrPortNotFound = errors.New("port not found") + func Stop(cs ...*Container) error + type Container struct + Host string + ID string + Ports NamedPorts + func Start(p Preset, opts ...Option) (*Container, error) + func StartCustom(image string, ports NamedPorts, opts ...Option) (*Container, error) + func (c *Container) Address(name string) string + func (c *Container) DefaultAddress() string + func (c *Container) DefaultPort() int + func (c *Container) DockerID() string + func (c *Container) Port(name string) int + type HealthcheckFunc func(context.Context, *Container) error + type InitFunc func(context.Context, *Container) error + type NamedPorts map[string]Port + func DefaultTCP(port int) NamedPorts + func (p NamedPorts) Find(proto string, portNum int) (string, error) + func (p NamedPorts) Get(name string) Port + type Option func(*Options) + func WithCommand(cmd string, args ...string) Option + func WithContainerName(name string) Option + func WithContext(ctx context.Context) Option + func WithCustomNamedPorts(namedPorts NamedPorts) Option + func WithDebugMode() Option + func WithDisableAutoCleanup() Option + func WithEnv(env string) Option + func WithHealthCheck(f HealthcheckFunc) Option + func WithHealthCheckInterval(t time.Duration) Option + func WithHostMounts(src, dst string) Option + func WithInit(f InitFunc) Option + func WithLogWriter(w io.Writer) Option + func WithOptions(options *Options) Option + func WithPrivileged() Option + func WithRegistryAuth(auth string) Option + func WithTimeout(t time.Duration) Option + func WithUseLocalImagesFirst() Option + type Options struct + Auth string + Cmd []string + ContainerName string + CustomNamedPorts NamedPorts + Debug bool + DisableAutoCleanup bool + Env []string + HostMounts map[string]string + Privileged bool + Timeout time.Duration + UseLocalImagesFirst bool + type Parallel struct + func InParallel() *Parallel + func (b *Parallel) Go() ([]*Container, error) + func (b *Parallel) Start(p Preset, opts ...Option) *Parallel + type Port struct + HostPort int + Port int + Protocol string + func TCP(port int) Port + type Preset interface + Image func() string + Options func() []Option + Ports func() NamedPorts