initial import
This commit is contained in:
18
core/discov/config.go
Normal file
18
core/discov/config.go
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user