MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / InitConfig

Function InitConfig

IceFireDB-Redis-Proxy/pkg/config/config.go:48–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46)
47
48func InitConfig() error {
49 if _config != nil {
50 return ErrDuplicateInitConfig
51 }
52
53 err := viper.Unmarshal(&_config)
54 if err != nil {
55 return err
56 }
57 if _config.IgnoreCMD.Enable && len(_config.IgnoreCMD.CMDList) > 0 {
58 CmdToUpper(_config.IgnoreCMD.CMDList)
59 }
60
61 if net.ParseIP(_config.P2P.NodeHostIP) == nil {
62 _config.P2P.NodeHostIP = "0.0.0.0"
63 }
64
65 if _config.P2P.NodeHostPort < 0 || _config.P2P.NodeHostPort > 65535 {
66 _config.P2P.NodeHostPort = 0
67 }
68
69 return nil
70}
71
72func Get() *Config {
73 return _config

Callers 2

newProxy2ServerFunction · 0.92
initConfigFunction · 0.92

Calls 1

CmdToUpperFunction · 0.70

Tested by

no test coverage detected