mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
22 lines
386 B
Go
22 lines
386 B
Go
package main
|
|
|
|
import (
|
|
_ "github.com/gogf/gf/example/config/consul/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, "redis.addr"))
|
|
}
|