containers

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

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

func Tar added in v1.5.0

func Tar(src string, w io.Writer) error

Tar takes a source and variable writers and walks 'source' writing each file found to the tar writer

func Untar added in v1.5.0

func Untar(dst string, r io.Reader) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

Types

type CGroup added in v1.4.0

type CGroup [2]string

CGroup defition

func (CGroup) Name added in v1.4.0

func (c CGroup) Name() string

func (CGroup) Subsystem added in v1.4.0

func (c CGroup) Subsystem() cgroups.Subsystem

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 ContainerDispatchArguments

type ContainerDispatchArguments struct {
	Container uint16     `json:"container"`
	Command   pm.Command `json:"command"`
}

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

func ContainerSubsystem(sink *transport.Sink, cell *screen.RowCell) (ContainerManager, error)

type Message

type Message struct {
	Type    string          `json:"type"`
	Command string          `json:"command"`
	Payload json.RawMessage `json:"payload"`
}

type NetworkConfig

type NetworkConfig struct {
	Dhcp    bool     `json:"dhcp"`
	CIDR    string   `json:"cidr"`
	Gateway string   `json:"gateway"`
	DNS     []string `json:"dns"`
}

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 NicState

type NicState string

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.

Jump to

Keyboard shortcuts

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