diff --git a/registry/registry.go b/registry/registry.go index 8a29d5cf..6ec72292 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -5,6 +5,15 @@ import ( "errors" ) +var ( + DefaultRegistry = NewRegistry() + + // Not found error when GetService is called + ErrNotFound = errors.New("service not found") + // Watcher stopped error when watcher is stopped + ErrWatcherStopped = errors.New("watcher stopped") +) + // The registry provides an interface for service discovery // and an abstraction over varying implementations // {consul, etcd, zookeeper, ...} @@ -25,15 +34,6 @@ type RegisterOption func(*RegisterOptions) type WatchOption func(*WatchOptions) -var ( - DefaultRegistry = NewRegistry() - - // Not found error when GetService is called - ErrNotFound = errors.New("service not found") - // Watcher stopped error when watcher is stopped - ErrWatcherStopped = errors.New("watcher stopped") -) - // Register a service node. Additionally supply options such as TTL. func Register(s *Service, opts ...RegisterOption) error { return DefaultRegistry.Register(s, opts...)