代码拉取完成,页面将自动刷新
package config
import conf "gitee.com/ssxlt/kratos-bootstrap/api/gen/go/conf/v1"
var configList []interface{}
var commonConfig = &conf.Bootstrap{}
func GetBootstrapConfig() *conf.Bootstrap {
return commonConfig
}
// RegisterConfig 注册配置
func RegisterConfig(c interface{}) {
initBootstrapConfig()
configList = append(configList, c)
}
func initBootstrapConfig() {
if len(configList) > 0 {
return
}
configList = append(configList, commonConfig)
if commonConfig.Server == nil {
commonConfig.Server = &conf.Server{}
configList = append(configList, commonConfig.Server)
}
if commonConfig.Client == nil {
commonConfig.Client = &conf.Client{}
configList = append(configList, commonConfig.Client)
}
if commonConfig.Data == nil {
commonConfig.Data = &conf.Data{}
configList = append(configList, commonConfig.Data)
}
if commonConfig.Trace == nil {
commonConfig.Trace = &conf.Tracer{}
configList = append(configList, commonConfig.Trace)
}
if commonConfig.Logger == nil {
commonConfig.Logger = &conf.Logger{}
configList = append(configList, commonConfig.Logger)
}
if commonConfig.Registry == nil {
commonConfig.Registry = &conf.Registry{}
configList = append(configList, commonConfig.Registry)
}
if commonConfig.Oss == nil {
commonConfig.Oss = &conf.OSS{}
configList = append(configList, commonConfig.Oss)
}
if commonConfig.Notify == nil {
commonConfig.Notify = &conf.Notification{}
configList = append(configList, commonConfig.Notify)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。