Documentation
¶
Overview ¶
Go (golang) Bindings for LXC (Linux Containers)
This package implements Go bindings for the LXC C API.
Index ¶
- Constants
- func ContainerNames() []string
- func DefaultConfigPath() string
- func GetContainer(lxc *Container) bool
- func PutContainer(lxc *Container) bool
- func Version() string
- type ByteSize
- type Container
- func (lxc *Container) CPUStats() ([]int64, error)
- func (lxc *Container) CPUTime() (time.Duration, error)
- func (lxc *Container) CPUTimePerCPU() ([]time.Duration, error)
- func (lxc *Container) CgroupItem(key string) []string
- func (lxc *Container) ClearConfigItem(key string) bool
- func (lxc *Container) ConfigFileName() string
- func (lxc *Container) ConfigItem(key string) []string
- func (lxc *Container) ConfigPath() string
- func (lxc *Container) Create(template string, args []string) bool
- func (lxc *Container) Daemonize() bool
- func (lxc *Container) Defined() bool
- func (lxc *Container) Destroy() bool
- func (lxc *Container) Freeze() bool
- func (lxc *Container) InitPID() int
- func (lxc *Container) Keys(key string) []string
- func (lxc *Container) LoadConfigFile(path string) bool
- func (lxc *Container) MemoryLimitInBytes() (ByteSize, error)
- func (lxc *Container) MemoryUsageInBytes() (ByteSize, error)
- func (lxc *Container) Name() string
- func (lxc *Container) NumberOfNetworkInterfaces() int
- func (lxc *Container) Running() bool
- func (lxc *Container) SaveConfigFile(path string) bool
- func (lxc *Container) SetCgroupItem(key string, value string) bool
- func (lxc *Container) SetConfigItem(key string, value string) bool
- func (lxc *Container) SetConfigPath(path string) bool
- func (lxc *Container) SetDaemonize()
- func (lxc *Container) Shutdown(timeout int) bool
- func (lxc *Container) Start(useinit bool, args []string) bool
- func (lxc *Container) State() State
- func (lxc *Container) Stop() bool
- func (lxc *Container) SwapLimitInBytes() (ByteSize, error)
- func (lxc *Container) SwapUsageInBytes() (ByteSize, error)
- func (lxc *Container) Unfreeze() bool
- func (lxc *Container) Wait(state State, timeout int) bool
- type State
Constants ¶
const ( // Timeout WAIT_FOREVER int = iota - 1 DONT_WAIT )
Variables ¶
This section is empty.
Functions ¶
func GetContainer ¶
Increments reference counter of the container object
func PutContainer ¶
Decrements reference counter of the container object
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func (*Container) CPUStats ¶
Returns the number of CPU cycles (in the units defined by USER_HZ on the system) consumed by tasks in this cgroup and its children in both user mode and system (kernel) mode.
func (*Container) CPUTime ¶
Returns the total CPU time (in nanoseconds) consumed by all tasks in this cgroup (including tasks lower in the hierarchy).
func (*Container) CPUTimePerCPU ¶
Returns the CPU time (in nanoseconds) consumed on each CPU by all tasks in this cgroup (including tasks lower in the hierarchy).
func (*Container) CgroupItem ¶
Returns the value of the given key
func (*Container) ClearConfigItem ¶
Clears the value of given key
func (*Container) ConfigFileName ¶
Returns the container's configuration file's name
func (*Container) ConfigItem ¶
Returns the value of the given key
func (*Container) ConfigPath ¶
Returns the configuration file's path
func (*Container) LoadConfigFile ¶
Loads the configuration file from given path
func (*Container) MemoryLimitInBytes ¶
func (*Container) MemoryUsageInBytes ¶
func (*Container) NumberOfNetworkInterfaces ¶
func (*Container) SaveConfigFile ¶
Saves the configuration file to given path
func (*Container) SetCgroupItem ¶
Sets the value of given key
func (*Container) SetConfigItem ¶
Sets the value of given key
func (*Container) SetConfigPath ¶
Sets the configuration file's path