api

package
v0.0.0-...-68efac8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Client

	Start() error
	Stop()

	GraceTime(Container) time.Duration
}

type BandwidthLimits

type BandwidthLimits struct {
	RateInBytesPerSecond      uint64
	BurstRateInBytesPerSecond uint64
}

type BindMount

type BindMount struct {
	SrcPath string
	DstPath string
	Mode    BindMountMode
	Origin  BindMountOrigin
}

type BindMountMode

type BindMountMode uint8
const BindMountModeRO BindMountMode = 0
const BindMountModeRW BindMountMode = 1

type BindMountOrigin

type BindMountOrigin uint8
const BindMountOriginContainer BindMountOrigin = 1
const BindMountOriginHost BindMountOrigin = 0

type CPULimits

type CPULimits struct {
	LimitInShares uint64
}

type Capacity

type Capacity struct {
	MemoryInBytes uint64
	DiskInBytes   uint64
	MaxContainers uint64
}

type Client

type Client interface {
	Ping() error

	Capacity() (Capacity, error)

	Create(ContainerSpec) (Container, error)
	Destroy(handle string) error
	Containers(Properties) ([]Container, error)
	Lookup(handle string) (Container, error)
}

type Container

type Container interface {
	Handle() string

	Stop(kill bool) error

	Info() (ContainerInfo, error)

	StreamIn(dstPath string, tarStream io.Reader) error
	StreamOut(srcPath string) (io.ReadCloser, error)

	LimitBandwidth(limits BandwidthLimits) error
	CurrentBandwidthLimits() (BandwidthLimits, error)

	LimitCPU(limits CPULimits) error
	CurrentCPULimits() (CPULimits, error)

	LimitDisk(limits DiskLimits) error
	CurrentDiskLimits() (DiskLimits, error)

	LimitMemory(limits MemoryLimits) error
	CurrentMemoryLimits() (MemoryLimits, error)

	NetIn(hostPort, containerPort uint32) (uint32, uint32, error)
	NetOut(network string, port uint32) error

	Run(ProcessSpec, ProcessIO) (Process, error)
	Attach(uint32, ProcessIO) (Process, error)
}

type ContainerBandwidthStat

type ContainerBandwidthStat struct {
	InRate   uint64
	InBurst  uint64
	OutRate  uint64
	OutBurst uint64
}

type ContainerCPUStat

type ContainerCPUStat struct {
	Usage  uint64
	User   uint64
	System uint64
}

type ContainerDiskStat

type ContainerDiskStat struct {
	BytesUsed  uint64
	InodesUsed uint64
}

type ContainerInfo

type ContainerInfo struct {
	State         string
	Events        []string
	HostIP        string
	ContainerIP   string
	ContainerPath string
	ProcessIDs    []uint32
	MemoryStat    ContainerMemoryStat
	CPUStat       ContainerCPUStat
	DiskStat      ContainerDiskStat
	BandwidthStat ContainerBandwidthStat
	Properties    Properties
	MappedPorts   []PortMapping
}

type ContainerMemoryStat

type ContainerMemoryStat struct {
	Cache                   uint64
	Rss                     uint64
	MappedFile              uint64
	Pgpgin                  uint64
	Pgpgout                 uint64
	Swap                    uint64
	Pgfault                 uint64
	Pgmajfault              uint64
	InactiveAnon            uint64
	ActiveAnon              uint64
	InactiveFile            uint64
	ActiveFile              uint64
	Unevictable             uint64
	HierarchicalMemoryLimit uint64
	HierarchicalMemswLimit  uint64
	TotalCache              uint64
	TotalRss                uint64
	TotalMappedFile         uint64
	TotalPgpgin             uint64
	TotalPgpgout            uint64
	TotalSwap               uint64
	TotalPgfault            uint64
	TotalPgmajfault         uint64
	TotalInactiveAnon       uint64
	TotalActiveAnon         uint64
	TotalInactiveFile       uint64
	TotalActiveFile         uint64
	TotalUnevictable        uint64
}

type ContainerSpec

type ContainerSpec struct {
	Handle     string
	GraceTime  time.Duration
	RootFSPath string
	BindMounts []BindMount
	Network    string
	Properties Properties
	Env        []string
}

type DiskLimits

type DiskLimits struct {
	BlockSoft uint64
	BlockHard uint64

	InodeSoft uint64
	InodeHard uint64

	ByteSoft uint64
	ByteHard uint64
}

type MemoryLimits

type MemoryLimits struct {
	LimitInBytes uint64
}

type PortMapping

type PortMapping struct {
	HostPort      uint32
	ContainerPort uint32
}

type Process

type Process interface {
	ID() uint32
	Wait() (int, error)
	SetTTY(TTYSpec) error
}

type ProcessIO

type ProcessIO struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type ProcessSpec

type ProcessSpec struct {
	Path string
	Args []string
	Env  []string
	Dir  string

	Privileged bool

	Limits ResourceLimits
	TTY    *TTYSpec
}

type Properties

type Properties map[string]string

type ResourceLimits

type ResourceLimits struct {
	As         *uint64
	Core       *uint64
	Cpu        *uint64
	Data       *uint64
	Fsize      *uint64
	Locks      *uint64
	Memlock    *uint64
	Msgqueue   *uint64
	Nice       *uint64
	Nofile     *uint64
	Nproc      *uint64
	Rss        *uint64
	Rtprio     *uint64
	Sigpending *uint64
	Stack      *uint64
}

type TTYSpec

type TTYSpec struct {
	WindowSize *WindowSize
}

type WindowSize

type WindowSize struct {
	Columns int
	Rows    int
}

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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