Skip to content

Commit

Permalink
gfconf支持adaptercentent
Browse files Browse the repository at this point in the history
  • Loading branch information
osgochina committed Jan 8, 2024
1 parent 794f659 commit c532a2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
6 changes: 5 additions & 1 deletion dserver/gfconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ func (that *DServer) getGFConf(confFile string) *gcfg.Config {
//如果并未设置配置文件,为了让程序不报错,写入空的配置
confPath, _ := getFilePath(gcfg.DefaultConfigFileName)
if len(confPath) <= 0 {
g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetContent("{}", gcfg.DefaultConfigFileName)
switch g.Cfg().GetAdapter().(type) {
case *gcfg.AdapterFile:
g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetContent("{}", gfile.Basename(gcfg.DefaultConfigFileName))
default:
}
}
return gcfg.Instance()
}
Expand Down
33 changes: 17 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module github.com/osgochina/dmicro

require (
github.com/desertbit/grumble v1.1.3
github.com/fatih/color v1.14.1
github.com/gogf/gf/v2 v2.3.2
github.com/fatih/color v1.15.0
github.com/gogf/gf/v2 v2.5.4
github.com/miekg/dns v1.1.51
github.com/modood/table v0.0.0-20220527013332-8d47e76dad33
github.com/prometheus/client_golang v1.14.0
Expand All @@ -13,25 +13,26 @@ require (
go.etcd.io/etcd/api/v3 v3.5.7
go.etcd.io/etcd/client/v3 v3.5.7
go.uber.org/zap v1.24.0
golang.org/x/net v0.8.0
golang.org/x/net v0.12.0
golang.org/x/sync v0.1.0
google.golang.org/grpc v1.41.0
google.golang.org/protobuf v1.28.1
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/BurntSushi/toml v1.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/clbanning/mxj/v2 v2.5.5 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/desertbit/closer/v3 v3.1.2 // indirect
github.com/desertbit/columnize v2.1.0+incompatible // indirect
github.com/desertbit/go-shlex v0.1.1 // indirect
github.com/desertbit/readline v1.5.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -47,8 +48,8 @@ require (
github.com/klauspost/reedsolomon v1.10.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo/v2 v2.2.0 // indirect
Expand All @@ -58,25 +59,25 @@ require (
github.com/prometheus/procfs v0.8.0 // indirect
github.com/quic-go/qtls-go1-19 v0.2.1 // indirect
github.com/quic-go/qtls-go1-20 v0.1.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/templexxx/cpu v0.0.9 // indirect
github.com/templexxx/xorsimd v0.4.1 // indirect
github.com/tjfoc/gmsm v1.4.1 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/sdk v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.4.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
google.golang.org/grpc v1.41.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down

0 comments on commit c532a2f

Please sign in to comment.