fix issue#10

This commit is contained in:
ginuerzh
2022-02-13 20:40:37 +08:00
parent a8804ea02d
commit edca3e0a55
5 changed files with 41 additions and 17 deletions

View File

@ -49,8 +49,8 @@ type LogConfig struct {
}
type ProfilingConfig struct {
Addr string `json:"addr"`
Enabled bool `json:"enabled"`
Addr string `json:"addr"`
Enable bool `json:"enable"`
}
type APIConfig struct {
@ -61,6 +61,12 @@ type APIConfig struct {
Auther string `yaml:",omitempty" json:"auther,omitempty"`
}
type MetricsConfig struct {
Enable bool `json:"enable"`
Addr string `json:"addr"`
Path string `json:"path"`
}
type TLSConfig struct {
CertFile string `yaml:"certFile,omitempty" json:"certFile,omitempty"`
KeyFile string `yaml:"keyFile,omitempty" json:"keyFile,omitempty"`
@ -211,6 +217,7 @@ type Config struct {
Log *LogConfig `yaml:",omitempty" json:"log,omitempty"`
Profiling *ProfilingConfig `yaml:",omitempty" json:"profiling,omitempty"`
API *APIConfig `yaml:",omitempty" json:"api,omitempty"`
Metrics *MetricsConfig `yaml:",omitempty" json:"metrics,omitempty"`
}
func (c *Config) Load() error {