Giter Site home page Giter Site logo

Comments (3)

shima-park avatar shima-park commented on May 25, 2024

你使用那种方式呢,默认的获取配置方式,还是结合viper方式。
可以的话贴下你的示例代码。

默认的读取方式

a, err := agollo. New(configServerUrl, appId, agollo.AutoFetchOnCacheMiss())
// .. err handle
fmt.Println(a.GetNameSpace("your_config.yaml"))

结合viper的读取方式
https://github.com/shima-park/agollo#%E7%BB%93%E5%90%88viper%E4%BD%BF%E7%94%A8%E6%8F%90%E9%AB%98%E9%85%8D%E7%BD%AE%E8%AF%BB%E5%8F%96%E8%88%92%E9%80%82%E5%BA%A6

from agollo.

1stmud avatar 1stmud commented on May 25, 2024

我用的viper方式, 找到不能获取配置文件的原因了, 我创建了一个私有类型是yaml格式的配置, namespace 取名test, 在 apollo后台看到namespace显示也是test , 但实际上是test.yaml

原addRemoteProvider的时候 path 是 test, 改成 test.yaml 好了。

yamltest.AddRemoteProvider("apollo","localhost:8080","test.yaml")

谢谢你大佬

from agollo.

shima-park avatar shima-park commented on May 25, 2024

是的,这点没注意很坑,apollo只有默认的properties格式的不用加后缀
其他的配置文件格式都需要加后缀

from agollo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.