You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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
|
|
}
|
|
}
|