mirror of
https://github.com/vbatts/go-cgroup.git
synced 2025-02-17 09:37:53 +00:00
adding a 'main' test file.
This commit is contained in:
parent
52eb5335f4
commit
ebf574023b
1 changed files with 34 additions and 0 deletions
34
main.go
Normal file
34
main.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
// cmpout
|
||||
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"."
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cgroup.Init()
|
||||
fmt.Println(cgroup.DeleteIgnoreMigration)
|
||||
fmt.Println(cgroup.DeleteIgnoreMigration|cgroup.DeleteEmptyOnly)
|
||||
|
||||
g := cgroup.NewCgroup("foo")
|
||||
c := g.AddController("bar")
|
||||
fmt.Printf("%#v\n", c)
|
||||
c = g.GetController("bar")
|
||||
fmt.Printf("%#v\n", c)
|
||||
|
||||
g.SetPermissions(cgroup.Mode(0777), cgroup.Mode(0777), cgroup.Mode(0777))
|
||||
|
||||
//fmt.Println(cgroup.GetSubSysMountPoint("cpu"))
|
||||
ctls, err := cgroup.GetAllControllers()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
for i := range ctls {
|
||||
fmt.Println(ctls[i])
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue