cgroup

package
v0.0.0-...-1f2438a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Sysfs string
}

Config is the cgroup driver configuration

type Driver

type Driver interface {
	Join(path string, cgroups []Kind) error
	Run(path string, cgroups []Kind, command string, args []string) error
	Attach(path string, cgroups []Kind, pid int) error
	Exit() error
}

Driver is a cgroup driver to join or execute into a given container's cgroup

func NewDriver

func NewDriver(config Config) Driver

NewDriver returns a cgroup driver from the given configuration

type Kind

type Kind string

Kind represents a cgroup name

const (

	// kinds
	Blkio     Kind = "blkio"
	CPU       Kind = "cpu,cpuacct"
	CPUSet    Kind = "cpuset"
	Devices   Kind = "devices"
	Freezer   Kind = "freezer"
	HugeTLB   Kind = "hugetlb"
	Memory    Kind = "memory"
	Net       Kind = "net_cls,net_prio"
	PerfEvent Kind = "perf_event"
	PIDs      Kind = "pids"
)

func AppendCgroups

func AppendCgroups(blkio, cpu, cpuset, devices, freezer, hugetlb, memory, net, perfevent, pids bool) []Kind

AppendCgroups creates a slice of the enabled cgroups

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL