Logo
Explore Help
Register Sign In
bingyi/gf
1
0
Fork 0
You've already forked gf
mirror of https://gitee.com/johng/gf synced 2026-07-07 14:25:17 +08:00
Code Issues Packages Projects Releases Wiki Activity
Files
2c22f4e17dd9191e80cf5fe6cd6da96c5cdc2d3a
gf/example/config/apollo/main.go

22 lines
390 B
Go
Raw Normal View History

add `gcfg.Adapter` implements using apollo service (#2165) * version updates * up * add watch feature for package kubecm * feat: support apollo as Adapter (#2143) * feat: support apollo as Adapter * feat: support apollo as Adapter * feat: support apollo as Adapter * feat: test apollo Adapter * feat: test apollo Adapter Co-authored-by: hongyihui <hongyihui@lixiang.com> Co-authored-by: houseme <housemecn@gmail.com> Co-authored-by: John Guo <john@johng.cn> * add gcfg.Adapter implements using apollo service * ci yaml update for apollo Co-authored-by: hong0220 <hong0220@users.noreply.github.com> Co-authored-by: hongyihui <hongyihui@lixiang.com> Co-authored-by: houseme <housemecn@gmail.com>
2022-09-30 18:19:52 +08:00
package main
import (
_ "github.com/gogf/gf/example/config/apollo/boot"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
)
func main() {
var ctx = gctx.GetInitCtx()
// Available checks.
g.Dump(g.Cfg().Available(ctx))
// All key-value configurations.
g.Dump(g.Cfg().Data(ctx))
// Retrieve certain value by key.
g.Dump(g.Cfg().MustGet(ctx, "server.address"))
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.2 Page: 23ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API