Documentation ¶
Index ¶
- func HostAddr(port int) string
- func HostIP() (string, error)
- type BuildImageConfig
- type Container
- type ContainerConfig
- type ContainerPort
- type ContainerType
- func (c *ContainerType) GetState(ctx context.Context) (*types.ContainerState, error)
- func (c *ContainerType) GetStateV2(ctx context.Context) (*types.ContainerState, error)
- func (c *ContainerType) Logs(ctx context.Context) (io.Reader, error)
- func (c *ContainerType) Name() string
- func (c *ContainerType) Start(ctx context.Context) error
- func (c *ContainerType) Stop(ctx context.Context) error
- func (c *ContainerType) WaitForReady(ctx context.Context) (state *types.ContainerState, err error)
- func (c *ContainerType) WaitForStatusHealthly(ctx context.Context) (state *types.ContainerState, err error)
- type Docker
- func (c *Docker) BuildImage(path, tag string) error
- func (c Docker) ContainerExists(ctx context.Context, containerID string) bool
- func (c *Docker) CreateNetwork(name string) (*Network, error)
- func (c Docker) ImageExists(ctx context.Context, image string) bool
- func (c *Docker) ImagePull(ctx context.Context, image string) error
- func (c *Docker) NewContainer(config ContainerConfig) (*ContainerType, error)
- func (c *Docker) PullImage(ref string) error
- func (c *Docker) PullImageIfNotExist(ctx context.Context, image string) error
- func (c *Docker) RemoveContainer(ctx context.Context, id string) error
- type HealthCheckConfig
- type HostPort
- type Mount
- type Mounts
- type MultiWaitPolicy
- type Network
- type NetworkConfig
- type PortMap
- type PullImageConfig
- type State
- type WaitForCommand
- type WaitForIt
- type WaitForPort
- type WaitForProcess
- type WaitPolicy
- type WaitWithDeley
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildImageConfig ¶
type ContainerConfig ¶
type ContainerConfig struct { Image string Env []string Name string PortMap PortMap PublishAllPorts bool EntryPoint []string Cmd []string Hostname string CapAdd []string Labels map[string]string Mounts Mounts NetworkName string Healtcheck *HealthCheckConfig AttachIfExist bool AutoRemove bool Privileged bool WaitPolicy WaitPolicy }
type ContainerPort ¶
type ContainerPort int
type ContainerType ¶
type ContainerType struct { ID string WaitPolicy WaitPolicy // contains filtered or unexported fields }
func (*ContainerType) GetState ¶
func (c *ContainerType) GetState(ctx context.Context) (*types.ContainerState, error)
func (*ContainerType) GetStateV2 ¶
func (c *ContainerType) GetStateV2(ctx context.Context) (*types.ContainerState, error)
func (*ContainerType) Name ¶
func (c *ContainerType) Name() string
func (*ContainerType) WaitForReady ¶
func (c *ContainerType) WaitForReady(ctx context.Context) (state *types.ContainerState, err error)
func (*ContainerType) WaitForStatusHealthly ¶
func (c *ContainerType) WaitForStatusHealthly(ctx context.Context) (state *types.ContainerState, err error)
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
func (*Docker) BuildImage ¶
func (Docker) ContainerExists ¶
ImageExists return if image is already present.
func (Docker) ImageExists ¶
ImageExists return if image is already present.
func (*Docker) NewContainer ¶
func (c *Docker) NewContainer(config ContainerConfig) (*ContainerType, error)
func (*Docker) PullImageIfNotExist ¶
PullImageIfNotExist fetch image from remote repository if not exits.
type HealthCheckConfig ¶
type MultiWaitPolicy ¶
type MultiWaitPolicy struct {
WaitPolicies []WaitForIt
}
func (*MultiWaitPolicy) WaitForIt ¶
func (w *MultiWaitPolicy) WaitForIt(ctx context.Context, c *ContainerType) error
type Network ¶
type Network struct { ID string NetworkConfig // contains filtered or unexported fields }
func NewNetwork ¶
func NewNetwork(client *Docker, config NetworkConfig) (*Network, error)
type NetworkConfig ¶
type PortMap ¶
type PortMap map[ContainerPort]HostPort
type PullImageConfig ¶
type PullImageConfig struct {
Ref string
}
type WaitForCommand ¶
type WaitForCommand struct {
Command string
}
func (*WaitForCommand) WaitForIt ¶
func (w *WaitForCommand) WaitForIt(ctx context.Context, c *ContainerType) error
type WaitForPort ¶
type WaitForPort struct {
Port int
}
func (*WaitForPort) WaitForIt ¶
func (w *WaitForPort) WaitForIt(ctx context.Context, c *ContainerType) error
type WaitForProcess ¶
type WaitForProcess struct {
Process string
}
func (*WaitForProcess) WaitForIt ¶
func (w *WaitForProcess) WaitForIt(ctx context.Context, c *ContainerType) error
type WaitPolicy ¶
type WaitPolicy interface { WaitForIt(context.Context, *ContainerType) error // contains filtered or unexported methods }
type WaitWithDeley ¶
func (*WaitWithDeley) WaitForIt ¶
func (w *WaitWithDeley) WaitForIt(ctx context.Context, c *ContainerType) error
Click to show internal directories.
Click to hide internal directories.