mirror of
				https://github.com/go-micro/go-micro.git
				synced 2025-10-30 23:27:41 +02:00 
			
		
		
		
	Move global vars to the top of the src file: conventions
This commit is contained in:
		| @@ -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...) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user