MCPcopy
hub / github.com/CodisLabs/codis / NewDefaultConfig

Function NewDefaultConfig

pkg/proxy/config.go:187–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185}
186
187func NewDefaultConfig() *Config {
188 c := &Config{}
189 if _, err := toml.Decode(DefaultConfig, c); err != nil {
190 log.PanicErrorf(err, "decode toml failed")
191 }
192 if err := c.Validate(); err != nil {
193 log.PanicErrorf(err, "validate config failed")
194 }
195 return c
196}
197
198func (c *Config) LoadFromFile(path string) error {
199 _, err := toml.DecodeFile(path, c)

Callers 2

TestBackendFunction · 0.70
newProxyConfigFunction · 0.70

Calls 3

ValidateMethod · 0.95
DecodeMethod · 0.80
PanicErrorfMethod · 0.80

Tested by 2

TestBackendFunction · 0.56
newProxyConfigFunction · 0.56