cgroup

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCgroupIDMapUnsupported = errors.New("cgroup change subscription failed (fanotify not available)")

ErrCgroupIDMapUnsupported is returned when cgroup id map is not available

Functions

This section is empty.

Types

type ChangeNotification added in v2.5.0

type ChangeNotification struct {
	ID     int
	Path   string
	Remove bool
}

ChangeNotification is the notification returned by cgroup monitor when a subscribed cgroup has been added or removed

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

Monitor resolves cgroup ids into their respective paths

func NewMonitor

func NewMonitor(path string) (*Monitor, error)

NewMonitor returns a new cgroup monitor for a given path

func (*Monitor) Resolve

func (m *Monitor) Resolve(id int) string

Resolve resolves an id to a path for a cgroup

func (*Monitor) SubscribeCgroupChange added in v2.5.0

func (m *Monitor) SubscribeCgroupChange(ch chan<- ChangeNotification) error

SubscribeCgroupChange receives cgroup change notifications. This requires kernel with fanotify support for cgroup

Jump to

Keyboard shortcuts

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