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

Function InitConfig

IceFireDB-SQLProxy/pkg/config/config.go:63–81  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

61var defaultConfig *Config
62
63func InitConfig(path string) {
64 viper.SetConfigFile(path)
65 if err := viper.ReadInConfig(); err != nil {
66 panic(err)
67 }
68
69 err := viper.Unmarshal(defaultConfig)
70 if err != nil {
71 panic(err)
72 }
73
74 if net.ParseIP(defaultConfig.P2P.NodeHostIP) == nil {
75 defaultConfig.P2P.NodeHostIP = "0.0.0.0"
76 }
77
78 if defaultConfig.P2P.NodeHostPort < 0 || defaultConfig.P2P.NodeHostPort > 65535 {
79 defaultConfig.P2P.NodeHostPort = 0
80 }
81}
82
83func Get() *Config {
84 return defaultConfig

Callers 1

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected