# Functions
AddProcesses add processes into cgroup.procs file.
CreateV1ControllerPath create path for controller with given group, prefix.
DetectType detects current mounted cgroup type in systemd default path.
EnableV2Nesting migrates all process in the container to nested /init path and enables all available controllers in the root cgroup.
EnsureDirExists creates directories if the path not exists.
GetAvailableController returns available cgroup controller in the system.
GetAvailableControllerV1 reads /proc/cgroups and get all available controller as set.
GetAvailableControllerV2 reads /sys/fs/cgroup/cgroup.controllers to get all controller.
GetAvailableControllerWithPrefix returns available cgroup controller within the cgroup prefix.
GetCgroupV1Info read /proc/cgroups and return the result.
GetCurrentCgroupPrefix returns the cgroup prefix of current process.
New creates a new cgroup with provided prefix, it opens existing one if existed.
OpenExisting opens a existing cgroup with provided prefix.
ReadProcesses reads cgroup.procs file and return pids individually.
# Variables
DetectedCgroupType defines the current cgroup type of the system.
ErrNotInitialized returned when trying to read from not initialized cgroup.
# Structs
Controllers defines enabled controller of a cgroup.
Info reads the cgroup mount info from /proc/cgroups.
V1 is the combination of v1 controllers.
V2 provides cgroup interface for v2.
# Interfaces
Cgroup defines the common interface to control cgroups including v1 and v2 implementations.
# Type aliases
Type defines the version of cgroup.