mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
move dockerhost into global config
This commit is contained in:
14
config.go
14
config.go
@@ -1,13 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
sortField string
|
||||
dockerHost string
|
||||
sortField string
|
||||
}
|
||||
|
||||
var DefaultConfig = NewDefaultConfig()
|
||||
|
||||
func NewDefaultConfig() Config {
|
||||
docker := os.Getenv("DOCKER_HOST")
|
||||
if docker == "" {
|
||||
docker = "unix:///var/run/docker.sock"
|
||||
}
|
||||
return Config{
|
||||
sortField: "id",
|
||||
dockerHost: docker,
|
||||
sortField: "id",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user