服务配置校验错误后仍然继续解析,不再停止运行

This commit is contained in:
刘祥超
2021-01-26 20:29:19 +08:00
parent cd780ce7b6
commit fc4daa74bd
2 changed files with 17 additions and 2 deletions

View File

@@ -30,6 +30,8 @@ type ServerConfig struct {
// 反向代理配置
ReverseProxyRef *ReverseProxyRef `yaml:"reverseProxyRef" json:"reverseProxyRef"`
ReverseProxy *ReverseProxyConfig `yaml:"reverseProxy" json:"reverseProxy"`
isOk bool
}
// 从JSON中解析Server配置
@@ -107,9 +109,16 @@ func (this *ServerConfig) Init() error {
}
}
this.isOk = true
return nil
}
// 配置是否正确
func (this *ServerConfig) IsOk() bool {
return this.isOk
}
func (this *ServerConfig) FullAddresses() []string {
result := []string{}
if this.HTTP != nil && this.HTTP.IsOn {