fix build

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-01-27 11:33:07 +03:00
parent 8a4ed24b38
commit 1f98cccac3
2 changed files with 15 additions and 42 deletions

View File

@@ -21,20 +21,14 @@ type etcdWatcher struct {
}
func newEtcdWatcher(c *clientv3.Client, timeout time.Duration, opts ...register.WatchOption) (register.Watcher, error) {
var wo register.WatchOptions
for _, o := range opts {
o(&wo)
}
if len(wo.Domain) == 0 {
wo.Domain = defaultDomain
}
wo := register.NewWatchOptions(opts...)
watchPath := prefix
watchPath := DefaultPrefix
if wo.Domain == register.WildcardDomain {
if len(wo.Service) > 0 {
return nil, errors.New("Cannot watch a service across domains")
}
watchPath = prefix
watchPath = DefaultPrefix
} else if len(wo.Service) > 0 {
watchPath = servicePath(wo.Domain, wo.Service) + "/"
}