Documentation ¶
Index ¶
- func ConvertKVStringsToMap(values []string) map[string]string
- func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.HostConfig, *flag.FlagSet, error)
- func ParseDevice(device string) (container.DeviceMapping, error)
- func ParseLink(val string) (string, string, error)
- func ParseRestartPolicy(policy string) (container.RestartPolicy, error)
- func ValidDeviceMode(mode string) bool
- func ValidateDevice(val string) (string, error)
- func ValidateLink(val string) (string, error)
- func ValidateThrottleBpsDevice(val string) (*blkiodev.ThrottleDevice, error)
- func ValidateThrottleIOpsDevice(val string) (*blkiodev.ThrottleDevice, error)
- func ValidateWeightDevice(val string) (*blkiodev.WeightDevice, error)
- type ThrottledeviceOpt
- type UlimitOpt
- type ValidatorThrottleFctType
- type ValidatorWeightFctType
- type WeightdeviceOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertKVStringsToMap ¶
ConvertKVStringsToMap converts ["key=value"] to {"key":"value"}
func Parse ¶
func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.HostConfig, *flag.FlagSet, error)
Parse parses the specified args for the specified command and generates a Config, a HostConfig and returns them with the specified command. If the specified args are not valid, it will return an error.
func ParseDevice ¶
func ParseDevice(device string) (container.DeviceMapping, error)
ParseDevice parses a device mapping string to a container.DeviceMapping struct
func ParseRestartPolicy ¶
func ParseRestartPolicy(policy string) (container.RestartPolicy, error)
ParseRestartPolicy returns the parsed policy or an error indicating what is incorrect
func ValidDeviceMode ¶
ValidDeviceMode checks if the mode for device is valid or not. Valid mode is a composition of r (read), w (write), and m (mknod).
func ValidateDevice ¶
ValidateDevice validates a path for devices It will make sure 'val' is in the form:
[host-dir:]container-path[:mode]
It also validates the device mode.
func ValidateLink ¶
ValidateLink validates that the specified string has a valid link format (containerName:alias).
func ValidateThrottleBpsDevice ¶
func ValidateThrottleBpsDevice(val string) (*blkiodev.ThrottleDevice, error)
ValidateThrottleBpsDevice validates that the specified string has a valid device-rate format.
func ValidateThrottleIOpsDevice ¶
func ValidateThrottleIOpsDevice(val string) (*blkiodev.ThrottleDevice, error)
ValidateThrottleIOpsDevice validates that the specified string has a valid device-rate format.
func ValidateWeightDevice ¶
func ValidateWeightDevice(val string) (*blkiodev.WeightDevice, error)
ValidateWeightDevice validates that the specified string has a valid device-weight format.
Types ¶
type ThrottledeviceOpt ¶
type ThrottledeviceOpt struct {
// contains filtered or unexported fields
}
ThrottledeviceOpt defines a map of ThrottleDevices
func NewThrottledeviceOpt ¶
func NewThrottledeviceOpt(validator ValidatorThrottleFctType) ThrottledeviceOpt
NewThrottledeviceOpt creates a new ThrottledeviceOpt
func (*ThrottledeviceOpt) GetList ¶
func (opt *ThrottledeviceOpt) GetList() []*blkiodev.ThrottleDevice
GetList returns a slice of pointers to ThrottleDevices.
func (*ThrottledeviceOpt) Set ¶
func (opt *ThrottledeviceOpt) Set(val string) error
Set validates a ThrottleDevice and sets its name as a key in ThrottledeviceOpt
func (*ThrottledeviceOpt) String ¶
func (opt *ThrottledeviceOpt) String() string
String returns ThrottledeviceOpt values as a string.
type UlimitOpt ¶
type UlimitOpt struct {
// contains filtered or unexported fields
}
UlimitOpt defines a map of Ulimits
func NewUlimitOpt ¶
NewUlimitOpt creates a new UlimitOpt
func (*UlimitOpt) GetList ¶
func (o *UlimitOpt) GetList() []*units.Ulimit
GetList returns a slice of pointers to Ulimits.
type ValidatorThrottleFctType ¶
type ValidatorThrottleFctType func(val string) (*blkiodev.ThrottleDevice, error)
ValidatorThrottleFctType defines a validator function that returns a validated struct and/or an error.
type ValidatorWeightFctType ¶
type ValidatorWeightFctType func(val string) (*blkiodev.WeightDevice, error)
ValidatorWeightFctType defines a validator function that returns a validated struct and/or an error.
type WeightdeviceOpt ¶
type WeightdeviceOpt struct {
// contains filtered or unexported fields
}
WeightdeviceOpt defines a map of WeightDevices
func NewWeightdeviceOpt ¶
func NewWeightdeviceOpt(validator ValidatorWeightFctType) WeightdeviceOpt
NewWeightdeviceOpt creates a new WeightdeviceOpt
func (*WeightdeviceOpt) GetList ¶
func (opt *WeightdeviceOpt) GetList() []*blkiodev.WeightDevice
GetList returns a slice of pointers to WeightDevices.
func (*WeightdeviceOpt) Set ¶
func (opt *WeightdeviceOpt) Set(val string) error
Set validates a WeightDevice and sets its name as a key in WeightdeviceOpt
func (*WeightdeviceOpt) String ¶
func (opt *WeightdeviceOpt) String() string
String returns WeightdeviceOpt values as a string.