cgroups

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CgroupNamePrefix = "name="
)

Variables

View Source
var (
	ErrV1NoUnified = errors.New("invalid configuration: cannot use unified on cgroup v1")
)
View Source
var (
	// TestMode is set to true by unit tests that need "fake" cgroupfs.
	TestMode bool
)

Functions

func FindCgroupMountpointAndRoot

func FindCgroupMountpointAndRoot(cgroupPath, subsystem string) (string, string, error)

func GetInitCgroup

func GetInitCgroup(subsystem string) (string, error)

func GetInitCgroupPath

func GetInitCgroupPath(subsystem string) (string, error)

func GetOwnCgroup

func GetOwnCgroup(subsystem string) (string, error)

GetOwnCgroup returns the relative path to the cgroup docker is running in.

func GetOwnCgroupPath

func GetOwnCgroupPath(subsystem string) (string, error)

func IsNotFound

func IsNotFound(err error) bool

func NewNotFoundError

func NewNotFoundError(sub string) error

func OpenFile

func OpenFile(dir, file string, flags int) (*os.File, error)

OpenFile opens a cgroup file in a given dir with given flags. It is supposed to be used for cgroup files only.

func ReadFile

func ReadFile(dir, file string) (string, error)

ReadFile reads data from a cgroup file in dir. It is supposed to be used for cgroup files only.

func WriteFile

func WriteFile(dir, file, data string) error

WriteFile writes data to a cgroup file in dir. It is supposed to be used for cgroup files only.

Types

type NotFoundError

type NotFoundError struct {
	Subsystem string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Directories

Path Synopsis
devicefilter
Package devicefilter contains eBPF device filter program The implementation is based on https://github.com/containers/crun/blob/0.10.2/src/libcrun/ebpf.c Although ebpf.c is originally licensed under LGPL-3.0-or-later, the author (Giuseppe Scrivano) agreed to relicense the file in Apache License 2.0: https://github.com/opencontainers/runc/issues/2144#issuecomment-543116397
Package devicefilter contains eBPF device filter program The implementation is based on https://github.com/containers/crun/blob/0.10.2/src/libcrun/ebpf.c Although ebpf.c is originally licensed under LGPL-3.0-or-later, the author (Giuseppe Scrivano) agreed to relicense the file in Apache License 2.0: https://github.com/opencontainers/runc/issues/2144#issuecomment-543116397

Jump to

Keyboard shortcuts

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