summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/cgroups/named.go
blob: f0fbf018ef414d333c8207b14ac72699a32a7539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package cgroups

import "path/filepath"

func NewNamed(root string, name Name) *namedController {
	return &namedController{
		root: root,
		name: name,
	}
}

type namedController struct {
	root string
	name Name
}

func (n *namedController) Name() Name {
	return n.name
}

func (n *namedController) Path(path string) string {
	return filepath.Join(n.root, string(n.name), path)
}