diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6716324 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.y?ml diff --git a/cmd/internal/config/config.go b/cmd/internal/config/config.go index 467e0dd..82daa47 100644 --- a/cmd/internal/config/config.go +++ b/cmd/internal/config/config.go @@ -10,8 +10,8 @@ import ( ) type ClientsConfig struct { - LogLevel string `json:"logLevel" yaml:"logLevel" env:"LOG_LEVEL" envDefault:"warn"` - LogFormat string `json:"logFormat" yaml:"logFormat" env:"LOG_FORMAT" envDefault:"console"` + LogLevel string `json:"logLevel" yaml:"logLevel" env:"LOG_LEVEL" default:"warn"` + LogFormat string `json:"logFormat" yaml:"logFormat" env:"LOG_FORMAT" default:"console"` Clients []ClientConfig `json:"clients" yaml:"clients" envPrefix:"CLIENT_"` } @@ -19,19 +19,19 @@ type ClientsConfig struct { type ClientType string const ( - TypeEdgeOS ClientType = "edgeOS" - TypeToughSwitch ClientType = "toughSwitch" + TypeEdgeOS ClientType = "edgeos" + TypeToughSwitch ClientType = "toughswitch" ) type ClientConfig struct { Type ClientType `json:"type" yaml:"type" env:"TYPE"` Name string `json:"name" yaml:"name" env:"NAME"` Host string `json:"host" yaml:"host" env:"HOST"` - Scheme string `json:"scheme" yaml:"scheme" env:"SCHEME" envDefault:"https"` + Scheme string `json:"scheme" yaml:"scheme" env:"SCHEME" default:"https"` User string `json:"user" yaml:"user" env:"USER"` Pass string `json:"pass" yaml:"pass" env:"PASS"` - Insecure bool `json:"insecure" yaml:"insecure" env:"INSECURE" envDefault:"false"` - Timeout time.Duration `json:"timeout" yaml:"timeout" env:"TIMEOUT" envDefault:"10s"` + Insecure bool `json:"insecure" yaml:"insecure" env:"INSECURE" default:"false"` + Timeout time.Duration `json:"timeout" yaml:"timeout" env:"TIMEOUT" default:"10s"` } // LoadConfig will load a file if given, layering env on-top of the config