Back to godoc.org

Package cgroups

v1.0.0
Latest Go to latest

The latest major version is v2.

Published: Mar 20, 2020 | License: MIT | Module: github.com/charSLee013/mydocker

Index

Variables

var Sugar *zap.SugaredLogger

func InitLog

func InitLog(sugar *zap.SugaredLogger)

type CgroupManager

type CgroupManager struct {
	// cgroup在hierarchy中的路径 相当于创建的cgroup目录相对于root cgroup目录的路径
	Path string
	// 资源配置
	Resource *subsystems.ResourceConfig
}

func NewCgroupManager

func NewCgroupManager(path string) *CgroupManager

func (*CgroupManager) Apply

func (c *CgroupManager) Apply(pid int) error

将进程pid加入到这个cgroup中

func (*CgroupManager) Destroy

func (c *CgroupManager) Destroy() error

释放cgroup

func (*CgroupManager) Set

func (c *CgroupManager) Set(res *subsystems.ResourceConfig) error

设置cgroup资源限制

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier