cgroup

package
v4.2.11+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 17 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 {
	// MountPath is where the cgroupv2 hierarchy is mounted.
	MountPath string
}

Config holds configuration for the cgroup service.

func (*Config) CheckAndSetDefaults

func (c *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks BPF configuration.

type Service

type Service struct {
	*Config
	// contains filtered or unexported fields
}

Service manages cgroup orchestration.

func New

func New(config *Config) (*Service, error)

New creates a new cgroup service.

func (*Service) Close

func (s *Service) Close() error

Close will unmount the cgroup filesystem.

func (*Service) Create

func (s *Service) Create(sessionID string) error

Create will create a cgroup for a given session.

func (*Service) ID

func (s *Service) ID(sessionID string) (uint64, error)

ID returns the cgroup ID for the given session.

func (*Service) Place

func (s *Service) Place(sessionID string, pid int) error

Place place a process in the cgroup for that session.

func (*Service) Remove

func (s *Service) Remove(sessionID string) error

Remove will remove the cgroup for a session. An existing processes will be moved to the root controller.

Jump to

Keyboard shortcuts

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