linux_container

package
v0.333.1-keep-me Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2016 License: Apache-2.0 Imports: 25 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MissingVersion = semver.Version{}

Functions

This section is empty.

Types

type BandwidthManager

type BandwidthManager interface {
	SetLimits(lager.Logger, garden.BandwidthLimits) error
	GetLimits(lager.Logger) (garden.ContainerBandwidthStat, error)
}

type CgroupsManager

type CgroupsManager interface {
	Set(subsystem, name, value string) error
	Get(subsystem, name string) (string, error)
	SubsystemPath(subsystem string) (string, error)
}

type ContainerSnapshot

type ContainerSnapshot struct {
	ID         string
	Handle     string
	RootFSPath string

	GraceTime time.Duration

	State  string
	Events []string

	Limits linux_backend.Limits

	Resources ResourcesSnapshot

	Processes               []linux_backend.ActiveProcess
	DefaultProcessSignaller bool

	NetIns  []linux_backend.NetInSpec
	NetOuts []garden.NetOutRule

	Properties garden.Properties

	EnvVars []string
}

type IPTablesManager

type IPTablesManager interface {
	ContainerSetup(containerID, bridgeName string, ip net.IP, network *net.IPNet) error
	ContainerTeardown(containerID string) error
}

type LinuxContainer

type LinuxContainer struct {
	linux_backend.LinuxContainerSpec
	// contains filtered or unexported fields
}

func NewLinuxContainer

func NewLinuxContainer(
	spec linux_backend.LinuxContainerSpec,
	portPool PortPool,
	runner command_runner.CommandRunner,
	cgroupsManager CgroupsManager,
	quotaManager QuotaManager,
	bandwidthManager BandwidthManager,
	processTracker process_tracker.ProcessTracker,
	filter network.Filter,
	ipTablesManager IPTablesManager,
	netStats NetworkStatisticser,
	oomWatcher Watcher,
	logger lager.Logger,
) *LinuxContainer

func (*LinuxContainer) Attach

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

func (*LinuxContainer) Cleanup

func (c *LinuxContainer) Cleanup() error

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) 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) ResourceSpec

func (*LinuxContainer) Restore

func (*LinuxContainer) RootFSPath

func (c *LinuxContainer) RootFSPath() string

func (*LinuxContainer) Run

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

func (*LinuxContainer) SetGraceTime

func (c *LinuxContainer) SetGraceTime(graceTime time.Duration) 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() linux_backend.State

func (*LinuxContainer) Stop

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

func (*LinuxContainer) StreamIn

func (c *LinuxContainer) StreamIn(spec garden.StreamInSpec) error

func (*LinuxContainer) StreamOut

func (c *LinuxContainer) StreamOut(spec garden.StreamOutSpec) (io.ReadCloser, error)

type NetworkStatisticser

type NetworkStatisticser interface {
	Statistics() (stats garden.ContainerNetworkStat, err error)
}

type OomNotifier

type OomNotifier struct {
	// contains filtered or unexported fields
}

func NewOomNotifier

func NewOomNotifier(runner command_runner.CommandRunner,
	containerPath string,
	cgroupsManager CgroupsManager) *OomNotifier

func (*OomNotifier) Unwatch

func (o *OomNotifier) Unwatch()

func (*OomNotifier) Watch

func (o *OomNotifier) Watch(onOom func()) error

type PortPool

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

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 QuotaManager

type QuotaManager interface {
	SetLimits(logger lager.Logger, containerRootFSPath string, limits garden.DiskLimits) error
	GetLimits(logger lager.Logger, containerRootFSPath string) (garden.DiskLimits, error)
	GetUsage(logger lager.Logger, containerRootFSPath string) (garden.ContainerDiskStat, error)

	Setup() error
}

type ResourcesSnapshot

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

type UndefinedPropertyError

type UndefinedPropertyError struct {
	Key string
}

func (UndefinedPropertyError) Error

func (err UndefinedPropertyError) Error() string

type Watcher

type Watcher interface {
	Watch(func()) error
	Unwatch()
}

Directories

Path Synopsis
fake_cgroup_reader
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
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
fake_chain
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