Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
// ContainerIP is the IP address from inside the container.
ContainerIP string `json:"container_ip"`
// ContainerPort is the port from inside the container.
ContainerPort int `json:"container_port"`
// HostIP is the IP address from outside the container. This can be
// different than the ContainerIP because of network forwarding on the host
// machine.
HostIP string `json:"host_ip"`
// HostPort is the IP port from outside the container. This can be different
// than the ContainerPort because of network forwarding on the host machine.
HostPort int `json:"host_port"`
}
Address represents an exposed port on a container.
type CheckConfig ¶
type CheckConfig struct {
// Port specifies the port inside the container that the service is listening on.
Port int
// Path specifies the path to request over HTTP (not including the '/' right after the host/port).
Path string
}
CheckConfig describes the configuration for an HTTP readiness check.
type ChecksConfig ¶
type ChecksConfig struct {
// PeriodSeconds is how long in seconds to wait between successive checks.
PeriodSeconds float64
// Checks describes all the checks that must pass for a container to be considered ready.
Checks []CheckConfig
}
ChecksConfig describes the configuration for multiple readiness checks.
type Container ¶
type Container struct {
ID ID `json:"id"`
State State `json:"state"`
Devices []device.Device `json:"devices"`
Description string `json:"description"` // This gets mapped to Docker labels, 63 chars.
}
Container tracks a container running in the cluster.
func (Container) DeviceUUIDsByType ¶
DeviceUUIDsByType returns the UUIDs of the devices with the given device type.
func (*Container) ToProto ¶
func (c *Container) ToProto() *containerv1.Container
ToProto returns the proto representation of the container.
func (Container) Transition ¶
Transition transitions the container state to the new state. An illegal transition will panic.
type ID ¶
type ID string
ID is a unique ID assigned to the containers of tasks when started in the cluster.
func (ID) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*ID) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type PullSpec ¶
type PullSpec struct {
ForcePull bool
Registry *types.AuthConfig
}
PullSpec contains configs for an ImagePull call.
type RunArchive ¶
type RunArchive struct {
Path string
Archive archive.Archive
CopyOptions types.CopyToContainerOptions
}
RunArchive contains one set of files sent over per CopyToContainer call.
type RunSpec ¶
type RunSpec struct {
ContainerConfig container.Config
HostConfig container.HostConfig
NetworkingConfig network.NetworkingConfig
Archives []RunArchive
DeviceType device.Type
Registry *types.AuthConfig
}
RunSpec contains configs for ContainerCreate, CopyToContainer, and ContainerStart calls.
type State ¶
type State string
State represents the current state of the container.
const ( // Assigned state means that the container has been assigned to an agent but has not started // yet. Assigned State = "ASSIGNED" // Pulling state means that the container's base image is being pulled from the Docker registry. Pulling State = "PULLING" // Starting state means that the image has been pulled and the container is being started, but // the container is not ready yet. Starting State = "STARTING" // Running state means that the service in the container is running. Running State = "RUNNING" // Terminated state means that the container has exited or has been aborted. Terminated State = "TERMINATED" // Unknown state is a null value. Unknown State = "" )
func ParseStateFromDocker ¶
ParseStateFromDocker parses raw docker state into our state.
func (State) Before ¶
Before returns if our state comes before or is equal to another. Callers have an implicit assumption that states always transition in order.
func (State) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (State) Proto ¶
func (s State) Proto() containerv1.State
Proto returns the proto representation of the container state.
func (*State) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.