cgroups

package
v0.0.0-...-a77887b Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CgroupManager

type CgroupManager struct {
	Name       string
	Limits     map[string]string
	Subsystems map[string]*Subsystem
}

func NewCgroupManager

func NewCgroupManager(name string, limits map[string]string) *CgroupManager

func (*CgroupManager) ApplyPid

func (c *CgroupManager) ApplyPid(pid int)

func (*CgroupManager) Destory

func (c *CgroupManager) Destory()

func (*CgroupManager) SetLimit

func (c *CgroupManager) SetLimit()

type Subsystem

type Subsystem struct {
	Name          string
	CgroupName    string
	Path          string
	LimitFilePath string
	TaskFilePath  string
	Limit         string
}

func InitCgroupSubSystem

func InitCgroupSubSystem(name string, cgroupName string, limit string, limitFileName string) (*Subsystem, error)

create subsystem cgroup dir

func (*Subsystem) ApplyPid

func (s *Subsystem) ApplyPid(pid int) error

func (*Subsystem) Remove

func (s *Subsystem) Remove() error

func (*Subsystem) SetLimit

func (s *Subsystem) SetLimit() error

Jump to

Keyboard shortcuts

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