add support for streaming requests. cleanup watcher initilisation

This commit is contained in:
Asim
2015-06-01 18:55:27 +01:00
parent fa2c27b64f
commit 09c784d294
25 changed files with 729 additions and 384 deletions

View File

@@ -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
}