Documentation ¶
Index ¶
- Constants
- type Device
- type DeviceNamed
- type Devices
- func (list Devices) Clone() Devices
- func (list Devices) CloneNative() map[string]map[string]string
- func (list Devices) Contains(k string, d Device) bool
- func (list Devices) Reversed() DevicesSortable
- func (list Devices) Sorted() DevicesSortable
- func (list Devices) Update(newlist Devices, updateFields func(Device, Device) []string) (map[string]Device, map[string]Device, map[string]Device, []string)
- type DevicesSortable
- type MountEntryItem
- type ProxyAddress
- type RootFSEntryItem
- type RunConfig
- type RunConfigItem
Constants ¶
const MountOwnerShiftDynamic = "dynamic"
MountOwnerShiftDynamic use shiftfs for dynamic owner shifting.
const MountOwnerShiftNone = ""
MountOwnerShiftNone do not use owner shifting.
const MountOwnerShiftStatic = "static"
MountOwnerShiftStatic statically modify ownership.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
Device represents a LXD container device
func (Device) NICType ¶
NICType returns the derived NIC Type for a NIC device. If the "network" property is specified then this implicitly (at least for now) means the nictype is "bridged". Otherwise the "nictype" property is returned. If the device type is not a NIC then an empty string is returned.
type DeviceNamed ¶
DeviceNamed contains the name of a device and its config.
type Devices ¶
Devices represents a set of LXD container devices
func NewDevices ¶
NewDevices creates a new Devices set from a native map[string]map[string]string set.
func (Devices) CloneNative ¶
CloneNative returns a copy of the Devices set as a native map[string]map[string]string type.
func (Devices) Contains ¶
Contains checks if a given device exists in the set and if it's identical to that provided
func (Devices) Reversed ¶
func (list Devices) Reversed() DevicesSortable
Reversed returns the name of all devices in the set, sorted reversed.
func (Devices) Sorted ¶
func (list Devices) Sorted() DevicesSortable
Sorted returns the name of all devices in the set, sorted properly.
type DevicesSortable ¶
type DevicesSortable []DeviceNamed
DevicesSortable is a sortable slice of device names and config.
func (DevicesSortable) Len ¶
func (devices DevicesSortable) Len() int
func (DevicesSortable) Less ¶
func (devices DevicesSortable) Less(i, j int) bool
func (DevicesSortable) Swap ¶
func (devices DevicesSortable) Swap(i, j int)
type MountEntryItem ¶
type MountEntryItem struct { DevName string // The internal name for the device. DevPath string // Describes the block special device or remote filesystem to be mounted. TargetPath string // Describes the mount point (target) for the filesystem. FSType string // Describes the type of the filesystem. Opts []string // Describes the mount options associated with the filesystem. Freq int // Used by dump(8) to determine which filesystems need to be dumped. Defaults to zero (don't dump) if not present. PassNo int // Used by fsck(8) to determine the order in which filesystem checks are done at boot time. Defaults to zero (don't fsck) if not present. OwnerShift string // Ownership shifting mode, use constants MountOwnerShiftNone, MountOwnerShiftStatic or MountOwnerShiftDynamic. }
MountEntryItem represents a single mount entry item.
type ProxyAddress ¶
ProxyAddress represents a proxy address configuration.
type RootFSEntryItem ¶
type RootFSEntryItem struct { Path string // Describes the root file system source. Opts []string // Describes the mount options associated with the filesystem. }
RootFSEntryItem represents the root filesystem options for an Instance.
type RunConfig ¶
type RunConfig struct { RootFS RootFSEntryItem // RootFS to setup. NetworkInterface []RunConfigItem // Network interface configuration settings. CGroups []RunConfigItem // Cgroup rules to setup. Mounts []MountEntryItem // Mounts to setup/remove. Uevents [][]string // Uevents to inject. PostHooks []func() error // Functions to be run after device attach/detach. }
RunConfig represents LXD defined run-time config used for device setup/cleanup.
type RunConfigItem ¶
RunConfigItem represents a single config item.