MCPcopy Index your code
hub / github.com/CodisLabs/codis / NewDefaultConfig

Function NewDefaultConfig

pkg/topom/config.go:87–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86
87func NewDefaultConfig() *Config {
88 c := &Config{}
89 if _, err := toml.Decode(DefaultConfig, c); err != nil {
90 log.PanicErrorf(err, "decode toml failed")
91 }
92 if err := c.Validate(); err != nil {
93 log.PanicErrorf(err, "validate config failed")
94 }
95 return c
96}
97
98func (c *Config) LoadFromFile(path string) error {
99 _, err := toml.DecodeFile(path, c)

Callers 1

topom_test.goFile · 0.70

Calls 3

ValidateMethod · 0.95
DecodeMethod · 0.80
PanicErrorfMethod · 0.80

Tested by

no test coverage detected