diff options
| author | Paul Buetow <paul@buetow.org> | 2024-06-17 11:01:20 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-06-17 11:01:20 +0300 |
| commit | fd005e1b770b071eaa137877d9fe7a5845670de9 (patch) | |
| tree | ebd68d99e035504520e04cde83f313892f61df51 /internal/config/client/client.go | |
| parent | 2f353f6d9aee9d9a989d11757289c11679752789 (diff) | |
add EDITOR client config, plus a bit refactor of the config env handling
Diffstat (limited to 'internal/config/client/client.go')
| -rw-r--r-- | internal/config/client/client.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/config/client/client.go b/internal/config/client/client.go index 9329759..65dd246 100644 --- a/internal/config/client/client.go +++ b/internal/config/client/client.go @@ -8,13 +8,16 @@ import ( type ClientConfig struct { Server string `json:"Partner,omitempty"` - ApiKey string `json:"ApiKey,omitempty"` + APIKey string `json:"APIKey,omitempty"` + Editor string `json:"Editor,omitempty"` } func New(configFile string) (ClientConfig, error) { conf, _ := config.FromFile[ClientConfig](configFile) - conf.Server = config.FromENV("Servers", conf.Server) - conf.ApiKey = config.FromENV("ApiKey", conf.ApiKey) + // TODO: Refactor + conf.Server = config.FromENV("GOS_SERVERS", conf.Server) + conf.APIKey = config.FromENV("GOS_API_KEY", conf.APIKey) + conf.Editor = config.FromENV("GOS_EDITOR", "EDITOR", conf.Editor, "vi") return conf, nil } |
