Documentation ¶
Index ¶
- func EnterPid(cgroupPaths map[string]string, pid int) error
- func FindCgroupMountpoint(subsystem string) (string, error)
- func GetAllSubsystems() ([]string, error)
- func GetInitCgroupDir(subsystem string) (string, error)
- func GetThisCgroupDir(subsystem string) (string, error)
- func IsNotFound(err error) bool
- func NewNotFoundError(sub string) error
- func ParseCgroupFile(subsystem string, r io.Reader) (string, error)
- func ReadProcsFile(dir string) ([]int, error)
- type ActiveCgroup
- type Cgroup
- type FreezerState
- type Mount
- type NotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllSubsystems ¶
Returns all the cgroup subsystems supported by the kernel
func GetInitCgroupDir ¶
func GetThisCgroupDir ¶
Returns the relative path to the cgroup docker is running in.
func IsNotFound ¶ added in v0.15.0
func NewNotFoundError ¶ added in v0.15.0
func ParseCgroupFile ¶ added in v0.15.0
func ReadProcsFile ¶
Types ¶
type ActiveCgroup ¶
type Cgroup ¶
type Cgroup struct { Name string `json:"name,omitempty"` Parent string `json:"parent,omitempty"` // name of parent cgroup or slice AllowAllDevices bool `json:"allow_all_devices,omitempty"` // If this is true allow access to any kind of device within the container. If false, allow access only to devices explicitly listed in the allowed_devices list. AllowedDevices []*devices.Device `json:"allowed_devices,omitempty"` Memory int64 `json:"memory,omitempty"` // Memory limit (in bytes) MemoryReservation int64 `json:"memory_reservation,omitempty"` // Memory reservation or soft_limit (in bytes) MemorySwap int64 `json:"memory_swap,omitempty"` // Total memory usage (memory + swap); set `-1' to disable swap CpuQuota int64 `json:"cpu_quota,omitempty"` // CPU hardcap limit (in usecs). Allowed cpu time in a given period. CpuPeriod int64 `json:"cpu_period,omitempty"` // CPU period to be used for hardcapping (in usecs). 0 to use system default. CpusetCpus string `json:"cpuset_cpus,omitempty"` // CPU to use Freezer FreezerState `json:"freezer,omitempty"` // set the freeze value for the process Slice string `json:"slice,omitempty"` // Parent slice to use for systemd }
type FreezerState ¶
type FreezerState string
const ( Undefined FreezerState = "" Frozen FreezerState = "FROZEN" Thawed FreezerState = "THAWED" )
type NotFoundError ¶ added in v0.15.0
type NotFoundError struct {
Subsystem string
}
func (*NotFoundError) Error ¶ added in v0.15.0
func (e *NotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.