We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apollo config.yaml 命名空间配置示例
a: b: c: 1
apollo 支持 yaml json 等格式的命名空间, 目前的做法是直接作为一个配置, 如 config.yaml 命名空间会被读取成 key 为 config.yaml.content, value 为 yaml 内容的一个配置.
config.yaml
config.yaml.content
希望可以实现解析, 按照 a.b.c 这样的方式直接读取到配置内容
The text was updated successfully, but these errors were encountered:
用户故事是什么,为何会需要同时支持2者,目前是2种分别支持,但是不能同时支持
Sorry, something went wrong.
你好, 可能我说的不太清楚, 不是同时支持两者, 是获取到的 apollo 配置没有进行解析, 还是原始的值.
apollo 配置, namespace: test, 类型: yml:
key1: key2: key3: 1
测试代码:
package main import ( "fmt" agollo "github.com/Shonminh/apollo-client" "github.com/go-chassis/go-archaius" "github.com/go-chassis/go-archaius/source/apollo" ) func main() { _ = archaius.Init(archaius.WithRemoteSource(archaius.ApolloSource, &archaius.RemoteInfo{ URL: "http://config.apollo.net", DefaultDimension: map[string]string{ apollo.AppID: "appid", apollo.NamespaceList: "test.yml", }, })) raw, _ := agollo.GetConfigByKey("test.yml.content") fmt.Printf("%v:%v\n", "test.yml.content", raw) // output: // test.yml.content:key1: // key2: // key3: 1 v, _ := agollo.GetConfigByKey("key1.key2.key3") fmt.Printf("%v:%v\n", "key1.key2.key3", v) // output: // key1.key2.key3: }
代码中 agollo.GetConfigByKey("key1.key2.key3") 预期输出的值是 apollo 配置中的 1, 结果是没有获取到.
agollo.GetConfigByKey("key1.key2.key3")
1
代码中 agollo.GetConfigByKey("test.yml.content") 输出的值是原始的 yml 内容, 说明并没有对 yml 进行解析.
agollo.GetConfigByKey("test.yml.content")
No branches or pull requests
apollo config.yaml 命名空间配置示例
apollo 支持 yaml json 等格式的命名空间, 目前的做法是直接作为一个配置, 如
config.yaml
命名空间会被读取成 key 为config.yaml.content
, value 为 yaml 内容的一个配置.希望可以实现解析, 按照 a.b.c 这样的方式直接读取到配置内容
The text was updated successfully, but these errors were encountered: