ctop/config.go

24 lines
329 B
Go
Raw Normal View History

2017-01-03 17:37:09 +00:00
package main
2017-01-04 17:50:49 +00:00
import (
"os"
)
2017-01-03 17:37:09 +00:00
type Config struct {
2017-01-04 17:50:49 +00:00
dockerHost string
sortField string
2017-01-03 17:37:09 +00:00
}
var DefaultConfig = NewDefaultConfig()
func NewDefaultConfig() Config {
2017-01-04 17:50:49 +00:00
docker := os.Getenv("DOCKER_HOST")
if docker == "" {
docker = "unix:///var/run/docker.sock"
}
2017-01-03 17:37:09 +00:00
return Config{
2017-01-04 17:50:49 +00:00
dockerHost: docker,
sortField: "id",
2017-01-03 17:37:09 +00:00
}
}