Documentation ¶
Overview ¶
Package cgroup provides an interface to read and write configuration to cgroup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cgroup ¶
type Cgroup struct { Name string `json:"name"` Parents map[string]string `json:"parents"` Own bool `json:"own"` }
Cgroup represents a group inside all controllers. For example: Name='/foo/bar' maps to /sys/fs/cgroup/<controller>/foo/bar on all controllers.
func New ¶
New creates a new Cgroup instance if the spec includes a cgroup path. Returns nil otherwise.
func (*Cgroup) Install ¶
func (c *Cgroup) Install(res *specs.LinuxResources) error
Install creates and configures cgroups according to 'res'. If cgroup path already exists, it means that the caller has already provided a pre-configured cgroups, and 'res' is ignored.
func (*Cgroup) Join ¶
Join adds the current process to the all controllers. Returns function that restores cgroup to the original state.
func (*Cgroup) MemoryLimit ¶
MemoryLimit returns the memory limit.