add support for streaming requests. cleanup watcher initilisation
This commit is contained in:
@@ -19,10 +19,6 @@ type kregistry struct {
|
||||
services map[string]*registry.Service
|
||||
}
|
||||
|
||||
func (c *kregistry) Watch() {
|
||||
newWatcher(c)
|
||||
}
|
||||
|
||||
func (c *kregistry) Deregister(s *registry.Service) error {
|
||||
return nil
|
||||
}
|
||||
@@ -97,6 +93,10 @@ func (c *kregistry) ListServices() ([]*registry.Service, error) {
|
||||
return services, nil
|
||||
}
|
||||
|
||||
func (c *kregistry) Watch() (registry.Watcher, error) {
|
||||
return newWatcher(c)
|
||||
}
|
||||
|
||||
func NewRegistry(addrs []string, opts ...registry.Option) registry.Registry {
|
||||
host := "http://" + os.Getenv("KUBERNETES_RO_SERVICE_HOST") + ":" + os.Getenv("KUBERNETES_RO_SERVICE_PORT")
|
||||
if len(addrs) > 0 {
|
||||
@@ -113,7 +113,5 @@ func NewRegistry(addrs []string, opts ...registry.Option) registry.Registry {
|
||||
services: make(map[string]*registry.Service),
|
||||
}
|
||||
|
||||
kr.Watch()
|
||||
|
||||
return kr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user