diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2018-04-09 12:16:11 -0400 |
---|---|---|
committer | Jesús Espino <jespinog@gmail.com> | 2018-04-09 18:16:11 +0200 |
commit | 0a6b96cb40d9dd5acca7e366df9cd14fa4eff6a7 (patch) | |
tree | 4b46ef4dc50aed2171d3b5ec38117a148db7ae29 /model/client4.go | |
parent | 57ee6f505e1b231733dc73dc25d2fbe14bd6b7d5 (diff) | |
download | chat-0a6b96cb40d9dd5acca7e366df9cd14fa4eff6a7.tar.gz chat-0a6b96cb40d9dd5acca7e366df9cd14fa4eff6a7.tar.bz2 chat-0a6b96cb40d9dd5acca7e366df9cd14fa4eff6a7.zip |
MM-9849 Added tracking of which settings are set through environment variables (#8586)
* MM-9849 Added tracking of which settings are set through environment variables
* Removed old version of viper
* Added forked version of viper
* Fixed unit tests
* Fixed more unit tests
* Removed copy from App.GetEnvironmentConfig
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 3346cc6eb..82d380440 100644 --- a/model/client4.go +++ b/model/client4.go @@ -2167,6 +2167,18 @@ func (c *Client4) GetOldClientConfig(etag string) (map[string]string, *Response) } } +// GetEnvironmentConfig will retrieve a map mirroring the server configuration where fields +// are set to true if the corresponding config setting is set through an environment variable. +// Settings that haven't been set through environment variables will be missing from the map. +func (c *Client4) GetEnvironmentConfig() (map[string]interface{}, *Response) { + if r, err := c.DoApiGet(c.GetConfigRoute()+"/environment", ""); err != nil { + return nil, BuildErrorResponse(r, err) + } else { + defer closeBody(r) + return StringInterfaceFromJson(r.Body), BuildResponse(r) + } +} + // GetOldClientLicense will retrieve the parts of the server license needed by the // client, formatted in the old format. func (c *Client4) GetOldClientLicense(etag string) (map[string]string, *Response) { |