mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
19 lines
285 B
Go
19 lines
285 B
Go
package discov
|
|
|
|
import "errors"
|
|
|
|
type EtcdConf struct {
|
|
Hosts []string
|
|
Key string
|
|
}
|
|
|
|
func (c EtcdConf) Validate() error {
|
|
if len(c.Hosts) == 0 {
|
|
return errors.New("empty etcd hosts")
|
|
} else if len(c.Key) == 0 {
|
|
return errors.New("empty etcd key")
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|