refactor config, add Switch and Param struct + config labels

This commit is contained in:
Bradley Cicenas
2017-02-16 03:02:13 +00:00
parent 5f13563b6f
commit 90f6ce3962
6 changed files with 106 additions and 44 deletions

33
config/param.go Normal file
View File

@@ -0,0 +1,33 @@
package config
var params = []*Param{
&Param{
key: "dockerHost",
val: getEnv("DOCKER_HOST", "unix:///var/run/docker.sock"),
label: "Docker API URL",
},
&Param{
key: "filterStr",
val: "",
label: "Container Name or ID Filter",
},
&Param{
key: "sortField",
val: "id",
label: "Container Sort Field",
},
}
type Param struct {
key string
val string
label string
}
// Return param value
func Get(k string) string {
if _, ok := Global.params[k]; ok == true {
return Global.params[k].val
}
return ""
}