Documentation
¶
Overview ¶
Package options provides options that can be used by container orchestration implementation.
Index ¶
- Constants
- func ApplyOptions(opts ...Option) *options
- func ParseCPUs(value float64) (int64, error)
- type FilterKey
- type ListContainerStreamer
- type ListImageStreamer
- type ListVolumeStreamer
- type LogStreamer
- type Option
- func Follow() Option
- func Force() Option
- func WithCPUs(cpus float64) Option
- func WithCapabilities(opts proto.Message) Option
- func WithDevices(devices []*cpb.Device) Option
- func WithEnv(envMapping map[string]string) Option
- func WithFilter(filter map[FilterKey][]string) Option
- func WithHardLimit(mem int64) Option
- func WithInstanceName(instance string) Option
- func WithLabels(labels map[string]string) Option
- func WithNetwork(network string) Option
- func WithPorts(portMappings map[uint32]uint32) Option
- func WithRegistryAuth(creds *tpb.Credentials) Option
- func WithRestartPolicy(opts proto.Message) Option
- func WithRunAs(opts proto.Message) Option
- func WithSince(t time.Duration) Option
- func WithSoftLimit(mem int64) Option
- func WithStream(client Stream) Option
- func WithTarget(image, tag string) Option
- func WithUntil(t time.Duration) Option
- func WithVolumeDriverOpts(opts proto.Message) Option
- func WithVolumeLabels(labels map[string]string) Option
- func WithVolumes(volumes []*cpb.Volume) Option
- type Stream
Constants ¶
const ( // Image filters for containers based on this image. Image FilterKey = "image" // Container filters by container name. Container = "container" // State filters by container state. State = "state" // Volume filters by volume name. Volume = "volume" )
Variables ¶
This section is empty.
Functions ¶
func ApplyOptions ¶
func ApplyOptions(opts ...Option) *options
ApplyOptions sets the passed options.
Types ¶
type ListContainerStreamer ¶
type ListContainerStreamer interface {
Send(msg *cpb.ListContainerResponse) error
}
ListContainerStreamer is an entity capable of streaming container information.
type ListImageStreamer ¶
type ListImageStreamer interface {
Send(msg *cpb.ListImageResponse) error
}
ListImageStreamer is an entity capable of streaming container information.
type ListVolumeStreamer ¶
type ListVolumeStreamer interface {
Send(msg *cpb.ListVolumeResponse) error
}
ListVolumeStreamer is an entity capable of streaming volume information.
type LogStreamer ¶
type LogStreamer interface {
Send(msg *cpb.LogResponse) error
}
LogStreamer is an entity capable of streaming logs.
type Option ¶
type Option func(*options)
Option takes an option and applies it to the set of options when the function is called.
func Force ¶
func Force() Option
Force sets the force operation field in the image options. Supported by: ContainerRemove, ContainerStop
func WithCPUs ¶
WithCPUs provides the CPU limit for the container. Supported by: ContainerStart, ContainerUpdate
func WithCapabilities ¶
WithCapabilities provides optional lists of added/removed container capabilities. Supported by: ContainerStart, ContainerUpdate
func WithDevices ¶
WithDevices sets the devices to attach to a container. Supported by: ContainerStart
func WithEnv ¶
WithEnv specifies the set environment variables to set in the container. Supported by: ContainerStart
func WithFilter ¶
WithFilter provides the filter option. Supported by: ContainerList, VolumeList
func WithHardLimit ¶
WithHardLimit provides the hard memory limit (in bytes) for the container. Supported by: ContainerStart, ContainerUpdate
func WithInstanceName ¶
WithInstanceName sets the name of the instance of a container. Supported by: ContainerStart
func WithLabels ¶
WithLabels provides an optional set of labels to attach to the container. Supported by: ContainerStart, ContainerUpdate
func WithNetwork ¶
WithNetwork provides the network to attach this container to. Supported by: ContainerStart, ContainerUpdate
func WithPorts ¶
WithPorts specifies the set of exposed ports for a container. Supported by: ContainerStart
func WithRegistryAuth ¶
func WithRegistryAuth(creds *tpb.Credentials) Option
WithRegistryAuth sets the credentials to use for this pull operation. Supported by: ImagePull
func WithRestartPolicy ¶
WithRestartPolicy provides an optional restart policy for the container. Supported by: ContainerStart, ContainerUpdate
func WithRunAs ¶
WithRunAs provides an optional user (and potentially group) to run the container as. Supported by: ContainerStart, ContainerUpdate
func WithSoftLimit ¶
WithSoftLimit provides the soft memory limit (in bytes) for the container. Supported by: ContainerStart, ContainerUpdate
func WithStream ¶
WithStream sets the stream to use to return results to the caller. Supported by: ImagePull
func WithTarget ¶
WithTarget sets the target image name and tag option for this pull operation. Supported by: ImagePush, ImagePull
func WithVolumeDriverOpts ¶
WithVolumeDriverOpts provides the volume driver options. Supported by: CreateVolume
func WithVolumeLabels ¶
WithVolumeLabels provides the volume labels. Supported by: CreateVolume
func WithVolumes ¶
WithVolumes sets the volumes to attach to a container. Supported by: ContainerStart
type Stream ¶
type Stream interface {
Send(*cpb.DeployResponse) error
}
Stream represents an entity capable of sending responses to the client.