Version: v0.0.0-...-33bca21 Latest Latest

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

Go to latest
Published: May 7, 2015 License: Apache-2.0 Imports: 24 Imported by: 0




View Source
const (
	StateBorn    = State("born")
	StateActive  = State("active")
	StateStopped = State("stopped")


This section is empty.


This section is empty.


type ContainerSnapshot

type ContainerSnapshot struct {
	ID     string
	Handle string

	GraceTime time.Duration

	State  string
	Events []string

	Limits LimitsSnapshot

	Resources ResourcesSnapshot

	Processes []ProcessSnapshot

	NetIns  []NetInSpec
	NetOuts []garden.NetOutRule

	Properties garden.Properties

	EnvVars []string

type LimitsSnapshot

type LimitsSnapshot struct {
	Memory    *garden.MemoryLimits
	Disk      *garden.DiskLimits
	Bandwidth *garden.BandwidthLimits
	CPU       *garden.CPULimits

type LinuxContainer

type LinuxContainer struct {
	// contains filtered or unexported fields

func NewLinuxContainer

func NewLinuxContainer(
	logger lager.Logger,
	id, handle, path string,
	properties garden.Properties,
	graceTime time.Duration,
	resources *linux_backend.Resources,
	portPool PortPool,
	runner command_runner.CommandRunner,
	cgroupsManager cgroups_manager.CgroupsManager,
	quotaManager quota_manager.QuotaManager,
	bandwidthManager bandwidth_manager.BandwidthManager,
	processTracker process_tracker.ProcessTracker,
	env process.Env,
	filter network.Filter,
) *LinuxContainer

func (*LinuxContainer) Attach

func (c *LinuxContainer) Attach(processID uint32, processIO garden.ProcessIO) (garden.Process, error)

func (*LinuxContainer) Cleanup

func (c *LinuxContainer) Cleanup()

func (*LinuxContainer) CurrentBandwidthLimits

func (c *LinuxContainer) CurrentBandwidthLimits() (garden.BandwidthLimits, error)

func (*LinuxContainer) CurrentCPULimits

func (c *LinuxContainer) CurrentCPULimits() (garden.CPULimits, error)

func (*LinuxContainer) CurrentDiskLimits

func (c *LinuxContainer) CurrentDiskLimits() (garden.DiskLimits, error)

func (*LinuxContainer) CurrentEnvVars

func (c *LinuxContainer) CurrentEnvVars() process.Env

func (*LinuxContainer) CurrentMemoryLimits

func (c *LinuxContainer) CurrentMemoryLimits() (garden.MemoryLimits, error)

func (*LinuxContainer) Events

func (c *LinuxContainer) Events() []string

func (*LinuxContainer) GraceTime

func (c *LinuxContainer) GraceTime() time.Duration

func (*LinuxContainer) Handle

func (c *LinuxContainer) Handle() string

func (*LinuxContainer) HasProperties

func (c *LinuxContainer) HasProperties(properties garden.Properties) bool

func (*LinuxContainer) ID

func (c *LinuxContainer) ID() string

func (*LinuxContainer) Info

func (*LinuxContainer) LimitBandwidth

func (c *LinuxContainer) LimitBandwidth(limits garden.BandwidthLimits) error

func (*LinuxContainer) LimitCPU

func (c *LinuxContainer) LimitCPU(limits garden.CPULimits) error

func (*LinuxContainer) LimitDisk

func (c *LinuxContainer) LimitDisk(limits garden.DiskLimits) error

func (*LinuxContainer) LimitMemory

func (c *LinuxContainer) LimitMemory(limits garden.MemoryLimits) error

func (*LinuxContainer) Metrics

func (c *LinuxContainer) Metrics() (garden.Metrics, error)

func (*LinuxContainer) NetIn

func (c *LinuxContainer) NetIn(hostPort uint32, containerPort uint32) (uint32, uint32, error)

func (*LinuxContainer) NetOut

func (c *LinuxContainer) NetOut(r garden.NetOutRule) error

func (*LinuxContainer) Properties

func (c *LinuxContainer) Properties() (garden.Properties, error)

func (*LinuxContainer) Property

func (c *LinuxContainer) Property(key string) (string, error)

func (*LinuxContainer) RemoveProperty

func (c *LinuxContainer) RemoveProperty(key string) error

func (*LinuxContainer) Resources

func (c *LinuxContainer) Resources() *linux_backend.Resources

func (*LinuxContainer) Restore

func (c *LinuxContainer) Restore(snapshot ContainerSnapshot) error

func (*LinuxContainer) Run

func (c *LinuxContainer) Run(spec garden.ProcessSpec, processIO garden.ProcessIO) (garden.Process, error)

func (*LinuxContainer) SetProperty

func (c *LinuxContainer) SetProperty(key string, value string) error

func (*LinuxContainer) Snapshot

func (c *LinuxContainer) Snapshot(out io.Writer) error

func (*LinuxContainer) Start

func (c *LinuxContainer) Start() error

func (*LinuxContainer) State

func (c *LinuxContainer) State() State

func (*LinuxContainer) Stop

func (c *LinuxContainer) Stop(kill bool) error

func (*LinuxContainer) StreamIn

func (c *LinuxContainer) StreamIn(dstPath string, tarStream io.Reader) error

func (*LinuxContainer) StreamOut

func (c *LinuxContainer) StreamOut(srcPath string) (io.ReadCloser, error)

type NetInSpec

type NetInSpec struct {
	HostPort      uint32
	ContainerPort uint32

type PortPool

type PortPool interface {
	Acquire() (uint32, error)
	Remove(uint32) error

type ProcessIDPool

type ProcessIDPool struct {
	// contains filtered or unexported fields

func (*ProcessIDPool) Next

func (p *ProcessIDPool) Next() uint32

func (*ProcessIDPool) Restore

func (p *ProcessIDPool) Restore(id uint32)

type ProcessSnapshot

type ProcessSnapshot struct {
	ID  uint32
	TTY bool

type ResourcesSnapshot

type ResourcesSnapshot struct {
	UserUID int
	RootUID int
	Network *linux_backend.Network
	Bridge  string
	Ports   []uint32

type State

type State string

type UndefinedPropertyError

type UndefinedPropertyError struct {
	Key string

func (UndefinedPropertyError) Error

func (err UndefinedPropertyError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL