Help us shape the future of Go! Take the 2026 Go Developer Survey

cgroups

package
v1.14.9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cgroup

type Cgroup struct {
	HierarchyID    string
	ControllerList string
	GroupPath      string
}

Cgroup represents a linux cgroup.

func GetCgroups

func GetCgroups(pid int32, fs FileSystem) ([]Cgroup, error)

GetCGroups returns a slice of cgroups for pid using fs for filesystem calls.

The expected cgroup format is "hierarchy-ID:controller-list:cgroup-path", and this function will return an error if every cgroup does not meet that format.

For more information, see:

type FileSystem

type FileSystem interface {
	// Open opens the named file for reading.
	Open(name string) (io.ReadCloser, error)
}

Filesystem abstracts filesystem operations.

type OSFileSystem

type OSFileSystem struct{}

OSFileSystem implements FileSystem using the local disk

func (OSFileSystem) Open

func (OSFileSystem) Open(name string) (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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