介绍一个我当初在鹅厂写过的吧。
完全的云原生环境下的配置管理。
结合 直接上代码给你看看吧。
type MyConf struct { TestKey1 string `cm:"testKey1"` TestKey2 int `cm:"testKey2"` TestKey3 struct { SubKey1 string `yaml:"subKey1"` SubKey2 int `yaml:"subKey2"` SubKey3 []string `yaml:"subKey3"` } `cm:"testKey3"` } func (c *MyConf) CMName() string { return "cm-op-config-test" } 使用? myConf := &My…。
上一篇 : 和女生合租,都会发生什么事情?
下一篇 : 网传一份东航事故调查进展的公开申请,称「危及社会稳定」不予公开,该答复是否可信?事故原因何时可能查明?