Documentation ¶
Index ¶
- Constants
- Variables
- func Tar(src string, w io.Writer) error
- func Untar(dst string, r io.Reader) error
- type CGroup
- type Container
- type ContainerArguments
- type ContainerCreateArguments
- type ContainerDispatchArguments
- type ContainerFindArguments
- type ContainerInfo
- type ContainerManager
- type Message
- type NetworkConfig
- type Nic
- type NicState
- type SortableDisks
Constants ¶
View Source
const ( OVSTag = "ovs" OVSBackPlane = "backplane" OVSVXBackend = "vxbackend" )
View Source
const ( BackendBaseDir = "/var/cache/containers" ContainerBaseRootDir = "/mnt/containers" )
View Source
const ( DefaultBridgeName = "core0" ContainersHardLimit = 1000 )
View Source
const ( NicStateConfigured = NicState("configured") NicStateDestroyed = NicState("destroyed") NicStateUnknown = NicState("unknown") NicStateError = NicState("error") )
View Source
const (
UnlockMagic = 0x280682
)
Variables ¶
View Source
var ( BridgeIP = []byte{172, 18, 0, 1} DefaultBridgeIP = fmt.Sprintf("%d.%d.%d.%d", BridgeIP[0], BridgeIP[1], BridgeIP[2], BridgeIP[3]) DefaultBridgeCIDR = fmt.Sprintf("%s/16", DefaultBridgeIP) DevicesCGroup = CGroup{string(cgroups.DevicesSubsystem), "corex"} )
Functions ¶
Types ¶
type Container ¶
type Container interface { ID() uint16 Arguments() ContainerCreateArguments }
type ContainerArguments ¶
type ContainerArguments struct {
Container uint16 `json:"container"`
}
type ContainerCreateArguments ¶
type ContainerCreateArguments struct { Root string `json:"root"` //Root plist Mount map[string]string `json:"mount"` //data disk mounts. HostNetwork bool `json:"host_network"` //share host networking stack Identity string `json:"identity"` //zerotier identity Nics []*Nic `json:"nics"` //network setup (only respected if HostNetwork is false) Port map[string]int `json:"port"` //port forwards (only if default networking is enabled) Privileged bool `json:"privileged"` //Apply cgroups and capabilities limitations on the container Hostname string `json:"hostname"` //hostname Storage string `json:"storage"` //ardb storage needed for g8ufs mounts. Name string `json:"name"` //for searching containers Tags pm.Tags `json:"tags"` //for searching containers Env map[string]string `json:"env"` //environment variables. CGroups []CGroup `json:"cgroups"` //container creation cgroups Config map[string]string `json:"config"` //overrides container config (from flist) }
func (*ContainerCreateArguments) Validate ¶
func (c *ContainerCreateArguments) Validate() error
type ContainerFindArguments ¶
type ContainerFindArguments struct {
Tags []string `json:"tags"`
}
type ContainerInfo ¶
type ContainerInfo struct { pm.ProcessStats Container Container `json:"container"` }
type ContainerManager ¶
type ContainerManager interface { Dispatch(id uint16, cmd *pm.Command) (*pm.JobResult, error) GetWithTags(tags ...string) []Container GetOneWithTags(tags ...string) Container Of(id uint16) Container }
func ContainerSubsystem ¶
type Message ¶
type Message struct { Type string `json:"type"` Command string `json:"command"` Payload json.RawMessage `json:"payload"` }
type NetworkConfig ¶
type Nic ¶
type Nic struct { Type string `json:"type"` ID string `json:"id"` HWAddress string `json:"hwaddr"` Name string `json:"name,omitempty"` Config NetworkConfig `json:"config"` Monitor bool `json:"monitor"` State NicState `json:"state"` Index int `json:"-"` OriginalHWAddress net.HardwareAddr `json:"-"` }
type SortableDisks ¶
type SortableDisks []disk.PartitionStat
func (SortableDisks) Len ¶
func (d SortableDisks) Len() int
func (SortableDisks) Less ¶
func (d SortableDisks) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (SortableDisks) Swap ¶
func (d SortableDisks) Swap(i, j int)
Swap swaps the elements with indexes i and j.
Click to show internal directories.
Click to hide internal directories.