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
Этот коммит содержится в:
Harrison Healey
2018-04-09 12:16:11 -04:00
коммит произвёл Jesús Espino
родитель 57ee6f505e
Коммит 0a6b96cb40
15 изменённых файлов: 266 добавлений и 55 удалений

Просмотреть файл

@@ -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) {