opts

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2016 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertKVStringsToMap

func ConvertKVStringsToMap(values []string) map[string]string

ConvertKVStringsToMap converts ["key=value"] to {"key":"value"}

func Parse

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 ParseLink(val string) (string, string, error)

ParseLink parses and validates the specified string as a link format (name:alias)

func ParseRestartPolicy

func ParseRestartPolicy(policy string) (container.RestartPolicy, error)

ParseRestartPolicy returns the parsed policy or an error indicating what is incorrect

func ValidDeviceMode

func ValidDeviceMode(mode string) bool

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

func ValidateDevice(val string) (string, error)

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(val string) (string, error)

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

func NewUlimitOpt(ref *map[string]*units.Ulimit) *UlimitOpt

NewUlimitOpt creates a new UlimitOpt

func (*UlimitOpt) GetList

func (o *UlimitOpt) GetList() []*units.Ulimit

GetList returns a slice of pointers to Ulimits.

func (*UlimitOpt) Set

func (o *UlimitOpt) Set(val string) error

Set validates a Ulimit and sets its name as a key in UlimitOpt

func (*UlimitOpt) String

func (o *UlimitOpt) String() string

String returns Ulimit values as a string.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL