go-cgroup/README.md

47 lines
641 B
Markdown
Raw Permalink Normal View History

# go-cgroup
2013-12-17 20:54:53 +00:00
Bindings to the libcgroup library
## Notice
2013-12-17 20:54:53 +00:00
_these bindings are incomplete_
2013-12-17 20:54:53 +00:00
## Installing
```shell
go get github.com/vbatts/go-cgroup
```
2013-12-17 20:54:53 +00:00
2014-02-17 02:06:40 +00:00
on debian, you'll need packages: golang, libcgroup-dev
on fedora, you'll need packages: golang, libcgroup-devel
## Sample
2013-12-17 20:54:53 +00:00
```golang
2016-02-19 15:07:11 +00:00
package main
2013-12-17 20:54:53 +00:00
2016-02-19 15:07:11 +00:00
import "github.com/vbatts/go-cgroup"
import "fmt"
2013-12-17 20:54:53 +00:00
2016-02-19 15:07:11 +00:00
func main() {
cgroup.Init()
2013-12-17 20:54:53 +00:00
2016-02-19 15:07:11 +00:00
fmt.Println(cgroup.GetSubSysMountPoint("cpu"))
2013-12-17 20:54:53 +00:00
2016-02-19 15:07:11 +00:00
ctls, err := cgroup.GetAllControllers()
if err != nil {
fmt.Println(err)
return
}
for i := range ctls {
fmt.Println(ctls[i])
}
}
```
2013-12-17 20:54:53 +00:00
## Contributing
2013-12-17 20:54:53 +00:00
Fork and Pull Request please!