Documentation ¶
Index ¶
- Constants
- Variables
- func NewInternalError(err error) error
- func NewInvalidInputError(err error) error
- func NewNotFoundError(err error) error
- type Container
- type ContainerFilter
- type ContainerHealth
- type ContainerNet
- type ContainerState
- type Device
- type ExecConfig
- type IPAddr
- type Image
- type ImageFilter
- type ImageRequest
- type InternalError
- type InvalidInputError
- type LogFilter
- type Mount
- type MountType
- type Network
- type NetworkType
- type NotFoundError
- type Port
- type PortBinding
- type PortType
- type RestartStrategy
- type RunConfig
- type Subnet
- type Volume
- type VolumeFilter
Constants ¶
View Source
const ( HeaderRequestID = "X-Request-ID" HeaderApiVer = "X-Api-Version" HeaderSrvName = "X-Service" )
View Source
const ( ContainersPath = "containers" ContainerStartPath = "start" ContainerStopPath = "stop" ContainerRestartPath = "restart" ContainerLogsPath = "logs" ContainerExecPath = "exec" ImagesPath = "images" NetworksPath = "networks" VolumesPath = "volumes" JobsPath = "jobs" JobsCancelPath = "cancel" SrvInfoPath = "info" RestrictedPath = "restricted" )
Variables ¶
View Source
var ContainerStateMap = map[ContainerState]struct{}{ InitState: {}, RunningState: {}, PausedState: {}, RestartingState: {}, RemovingState: {}, StoppedState: {}, DeadState: {}, }
View Source
var MountTypeMap = map[MountType]struct{}{ BindMount: {}, VolumeMount: {}, TmpfsMount: {}, }
View Source
var NetworkTypeMap = map[NetworkType]struct{}{ BridgeNet: {}, MACVlanNet: {}, HostNet: {}, }
View Source
var PortTypeMap = map[PortType]struct{}{ TcpPort: {}, UdpPort: {}, SctpPort: {}, }
View Source
var RestartStrategyMap = map[RestartStrategy]struct{}{ RestartNever: {}, RestartAlways: {}, RestartNotStopped: {}, RestartOnFail: {}, }
Functions ¶
func NewInternalError ¶ added in v0.5.0
func NewInvalidInputError ¶ added in v0.5.0
func NewNotFoundError ¶ added in v0.5.0
Types ¶
type Container ¶
type Container struct { ID string `json:"id"` Name string `json:"name"` State ContainerState `json:"state"` Health *ContainerHealth `json:"health"` Created time.Time `json:"created"` Started *time.Time `json:"started"` Image string `json:"image"` ImageID string `json:"image_id"` EnvVars map[string]string `json:"env_vars"` Labels map[string]string `json:"labels"` Mounts []Mount `json:"mounts"` Devices []Device `json:"devices"` Ports []Port `json:"ports"` Networks []ContainerNet `json:"networks"` RunConfig RunConfig `json:"run_config"` }
type ContainerFilter ¶
type ContainerFilter struct { Name string State ContainerState Labels map[string]string }
type ContainerHealth ¶ added in v0.8.0
type ContainerHealth = string
const ( HealthyState ContainerHealth = "healthy" UnhealthyState ContainerHealth = "unhealthy" TransitionState ContainerHealth = "transitioning" )
type ContainerNet ¶
type ContainerState ¶
type ContainerState = string
const ( InitState ContainerState = "initialized" RunningState ContainerState = "running" PausedState ContainerState = "paused" RestartingState ContainerState = "restarting" RemovingState ContainerState = "removing" StoppedState ContainerState = "stopped" DeadState ContainerState = "dead" )
type Device ¶ added in v0.7.0
type ExecConfig ¶ added in v0.13.0
type ImageRequest ¶
type ImageRequest struct {
Image string `json:"image"`
}
type InternalError ¶ added in v0.5.0
type InternalError struct {
// contains filtered or unexported fields
}
type InvalidInputError ¶ added in v0.5.0
type InvalidInputError struct {
// contains filtered or unexported fields
}
type Mount ¶
type Network ¶
type Network struct { ID string `json:"id"` Name string `json:"name"` Type NetworkType `json:"type"` Subnet Subnet `json:"subnet"` Gateway IPAddr `json:"gateway"` }
type NetworkType ¶
type NetworkType = string
const ( BridgeNet NetworkType = "bridge" MACVlanNet NetworkType = "macvlan" HostNet NetworkType = "host" )
type NotFoundError ¶ added in v0.5.0
type NotFoundError struct {
// contains filtered or unexported fields
}
type Port ¶
type Port struct { Number int `json:"number"` Protocol PortType `json:"protocol"` Bindings []PortBinding `json:"bindings"` }
type PortBinding ¶
type RestartStrategy ¶
type RestartStrategy = string
const ( RestartNever RestartStrategy = "never" RestartAlways RestartStrategy = "always" RestartNotStopped RestartStrategy = "not-stopped" RestartOnFail RestartStrategy = "on-fail" )
type RunConfig ¶
type RunConfig struct { RestartStrategy RestartStrategy `json:"restart_strategy"` Retries *int `json:"retries"` RemoveAfterRun bool `json:"remove_after_run"` StopTimeout *time.Duration `json:"stop_timeout"` StopSignal *string `json:"stop_signal"` PseudoTTY bool `json:"pseudo_tty"` Command []string `json:"command"` }
type VolumeFilter ¶
Click to show internal directories.
Click to hide internal directories.