Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCgroupAlreadyExists = errors.New("nested cgroup already exists") ErrCgroupNotExists = errors.New("nested cgroup does not exist") )
Functions ¶
func NewCgroupManager ¶
func NewCgroupManager(name string, res *specs.LinuxResources) (CGroup, CGroupManager, error)
Types ¶
type CGroup ¶
type CGroup interface {
// New creates a new cgroup under the calling cgroup.
New(name string, resources *specs.LinuxResources) (CGroup, error)
// Add adds a process to the cgroup
Add(Process) error
// Delete removes the cgroup as a whole.
Delete() error
// Stats returns resource description
Stats() (*Stats, error)
Suffix() string
}
type CGroupManager ¶
type CGroupManager interface {
// Parent returns a parent cgroup.
Parent() CGroup
// Attach attaches a new nested cgroup under the parent cgroup, returning
// that new cgroup handle.
// Also returns cgroup handle if it is already exists.
Attach(name string, resources *specs.LinuxResources) (CGroup, error)
// Detach detaches and deletes a nested cgroup.
Detach(name string) error
}
Click to show internal directories.
Click to hide internal directories.