Versions in this module Expand all Collapse all v1 v1.2.1 Jun 4, 2023 v1.2.0 Apr 27, 2023 Changes in this version + const ErrContainerAlreadyStoped + const ErrContainerDidntStart + const ErrContainerExitedBeforeReady + const StartTimeoutFactorEnvar + func CheckImages(cli Client, opts ...ImageOption) error + func SliceToSet(slice []string) map[string]struct + type AddrsMap map[ports.PortName]string + type BaseContainer struct + Autoremove bool + Background bool + Cmd []string + ConfController envs.Controller + ContainerIP string + Ctx context.Context + DebugPort ports.DebugPort + EntryPoint string + Envs []string + ErrorStream io.Writer + Image string + Mounts []string + Name string + NotBindPorts bool + OutputStream io.Writer + Ports PortBinds + Ready ReadyFunc + StartTimeout time.Duration + Sysctls map[string]string + TypeID uint8 + Volumes []string + func NewBaseContainer(cli Client, nw Network, confCtl envs.Controller) *BaseContainer + func (c *BaseContainer) ContainerAddrs() AddrsMap + func (c *BaseContainer) ContainerPorts() []Port + func (c *BaseContainer) CreateContainer() error + func (c *BaseContainer) GetAutoremove() bool + func (c *BaseContainer) GetClient() Client + func (c *BaseContainer) GetCmd() []string + func (c *BaseContainer) GetContainerIP() string + func (c *BaseContainer) GetEntryPoint() string + func (c *BaseContainer) GetEnvs() []string + func (c *BaseContainer) GetID() string + func (c *BaseContainer) GetImage() string + func (c *BaseContainer) GetMounts() []string + func (c *BaseContainer) GetName() string + func (c *BaseContainer) GetNetwork() Network + func (c *BaseContainer) GetSysctls() map[string]string + func (c *BaseContainer) GetVolumes() []string + func (c *BaseContainer) HostAddrs() AddrsMap + func (c *BaseContainer) HostIP() string + func (c *BaseContainer) HostPort(name ports.PortName) string + func (c *BaseContainer) LogError(err error, args ...any) bool + func (c *BaseContainer) LogStderr(format string, args ...any) bool + func (c *BaseContainer) LogStdout(format string, args ...any) bool + func (c *BaseContainer) PortMap() PortMap + func (c *BaseContainer) StartContainer(sigCh <-chan os.Signal, ready chan<- struct{}) error + func (c *BaseContainer) Stop() error + type Client interface + BuildImage func(data *ImageBuildData) error + CheckNetwork func(nw, cidr string) (Network, error) + ContainerCreate func(ctx context.Context, data Container) (string, error) + ContainerStart func(ctx context.Context, id, name string) (*ContainerInfo, error) + ContainerStop func(ctx context.Context, id string, timeout time.Duration) error + ContainerWait func(ctx context.Context, id string) (<-chan ContainerStatus, <-chan error) + FindImageLocal func(ctx context.Context, image string) (bool, error) + IsInContainer func() bool + NetworkList func(ctx context.Context) ([]*net.IPNet, error) + NextSubnet func() (*net.IPNet, error) + PullImage func(image string) error + RemoveImage func(image string) + RemoveNetwork func(id string) error + StreamLogs func(ctx context.Context, id string, stderr, stdout io.Writer, follow bool) error + WithStderr func(w io.Writer) Client + WithStdout func(w io.Writer) Client + type Container interface + ContainerAddrs func() AddrsMap + ContainerPorts func() []Port + CreateContainer func() error + GetAutoremove func() bool + GetClient func() Client + GetCmd func() []string + GetContainerIP func() string + GetEntryPoint func() string + GetEnvs func() []string + GetID func() string + GetImage func() string + GetMounts func() []string + GetName func() string + GetNetwork func() Network + GetSysctls func() map[string]string + GetVolumes func() []string + HostAddrs func() AddrsMap + LogError func(err error, args ...any) bool + LogStderr func(format string, args ...any) bool + LogStdout func(format string, args ...any) bool + PortMap func() PortMap + StartContainer func(sigCh <-chan os.Signal, ready chan<- struct{}) error + Stop func() error + type ContainerInfo struct + ID string + IPAddress string + Networks map[string]EndpointSettings + PortBinds PortMap + type ContainerStatus struct + Error error + StatusCode int64 + type EndpointSettings struct + IPAddress string + type ImageBuildData struct + Args map[string]*string + ClearRoot bool + Dockerfile string + Nocache bool + Output io.Writer + Root string + Tags []string + type ImageBuildPreparer func() (*ImageBuildData, error) + type ImageOption func(o *ImageOptions) + func WithBuildImage(preparer ImageBuildPreparer, forceBuild bool) ImageOption + func WithPullImage(tag string) ImageOption + type ImageOptions struct + Data *ImageBuildData + Err error + ForceBuild bool + Pull bool + Tags []string + type Images map[string]ImageOption + type Network interface + AddContainer func(info *OrchestratorInfo) + Gateway func() string + HostIP func() string + ID func() string + Name func() string + NextIP func() string + type OrchestratorInfo struct + ContainerEnpoints AddrsMap + HostEnpoints AddrsMap + ID string + TypeID uint8 + type Port string + func NewPort(port uint16, proto string) Port + func (p Port) Port() string + func (p Port) Proto() string + type PortBind struct + Container Port + Host uint16 + Name ports.PortName + type PortBinding struct + HostIP string + HostPort string + type PortBinds []PortBind + func (pb PortBinds) Names() map[string]ports.PortName + type PortMap map[Port][]PortBinding + type ReadyFunc func(ctx context.Context) <-chan struct