MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / Validate

Method Validate

config/config.go:95–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93}
94
95func (c *Config) Validate() error {
96 if c.Controller.FailOver.MaxPingCount < 3 {
97 return errors.New("max ping count required >= 3")
98 }
99 if c.Controller.FailOver.PingIntervalSeconds < 1 {
100 return errors.New("ping interval required >= 1s")
101 }
102 hostPort := strings.Split(c.Addr, ":")
103 if hostPort[0] == "0.0.0.0" || hostPort[0] == "127.0.0.1" {
104 logger.Get().Warn("Leader forward may not work if the host is " + hostPort[0])
105 }
106 return nil
107}
108
109func (c *Config) getAddr() string {
110 // env has higher priority than configuration.

Callers 1

mainFunction · 0.45

Calls 1

GetFunction · 0.92

Tested by

no test coverage detected