2014-01-20 19:15:44 +00:00
|
|
|
package cgroups
|
|
|
|
|
|
|
|
import (
|
2014-04-14 00:02:01 +00:00
|
|
|
"errors"
|
2014-01-20 19:15:44 +00:00
|
|
|
)
|
|
|
|
|
2014-04-14 00:02:01 +00:00
|
|
|
var (
|
|
|
|
ErrNotFound = errors.New("mountpoint not found")
|
|
|
|
)
|
|
|
|
|
2014-02-20 23:48:48 +00:00
|
|
|
type Cgroup struct {
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Parent string `json:"parent,omitempty"`
|
|
|
|
|
2014-03-21 14:53:47 +00:00
|
|
|
DeviceAccess bool `json:"device_access,omitempty"` // name of parent cgroup or slice
|
|
|
|
Memory int64 `json:"memory,omitempty"` // Memory limit (in bytes)
|
|
|
|
MemorySwap int64 `json:"memory_swap,omitempty"` // Total memory usage (memory + swap); set `-1' to disable swap
|
|
|
|
CpuShares int64 `json:"cpu_shares,omitempty"` // CPU shares (relative weight vs. other containers)
|
|
|
|
CpusetCpus string `json:"cpuset_cpus,omitempty"` // CPU to use
|
2014-02-21 13:35:43 +00:00
|
|
|
|
|
|
|
UnitProperties [][2]string `json:"unit_properties,omitempty"` // systemd unit properties
|
2014-02-20 23:48:48 +00:00
|
|
|
}
|
|
|
|
|
2014-03-14 09:47:49 +00:00
|
|
|
type ActiveCgroup interface {
|
|
|
|
Cleanup() error
|
2014-02-20 23:48:48 +00:00
|
|
|
}
|