support custom url for health URI. (#302)

* support custom url for health URI.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix readme

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2017-10-25 21:19:58 -05:00
committed by GitHub
parent 313d74c927
commit e99692717c
5 changed files with 10 additions and 1 deletions

View File

@@ -44,6 +44,7 @@ api:
config_uri: "/api/config"
sys_stat_uri: "/sys/stats"
metric_uri: "/metrics"
health_uri: "/healthz"
android:
enabled: true
@@ -126,6 +127,7 @@ type SectionAPI struct {
ConfigURI string `yaml:"config_uri"`
SysStatURI string `yaml:"sys_stat_uri"`
MetricURI string `yaml:"metric_uri"`
HealthURI string `yaml:"health_uri"`
}
// SectionAndroid is sub section of config.
@@ -261,6 +263,7 @@ func LoadConf(confPath string) (ConfYaml, error) {
conf.API.ConfigURI = viper.GetString("api.config_uri")
conf.API.SysStatURI = viper.GetString("api.sys_stat_uri")
conf.API.MetricURI = viper.GetString("api.metric_uri")
conf.API.HealthURI = viper.GetString("api.health_uri")
// Android
conf.Android.Enabled = viper.GetBool("android.enabled")