The registry provides an interface for service discovery and an abstraction over varying implementations {consul, etcd, zookeeper, ...}.
| 16 | // and an abstraction over varying implementations |
| 17 | // {consul, etcd, zookeeper, ...}. |
| 18 | type Registry interface { |
| 19 | Init(...Option) error |
| 20 | Options() Options |
| 21 | Register(*Service, ...RegisterOption) error |
| 22 | Deregister(*Service, ...DeregisterOption) error |
| 23 | GetService(string, ...GetOption) ([]*Service, error) |
| 24 | ListServices(...ListOption) ([]*Service, error) |
| 25 | Watch(...WatchOption) (Watcher, error) |
| 26 | String() string |
| 27 | } |
| 28 | |
| 29 | type Service struct { |
| 30 | Name string `json:"name"` |
no outgoing calls
no test coverage detected
searching dependent graphs…