Documentation ¶
Overview ¶
Package registry is an interface for service discovery
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Not found error when GetService is called ErrNotFound = errors.New("not found") // Watcher stopped error when watcher is stopped ErrWatcherStopped = errors.New("watcher stopped") )
Functions ¶
This section is empty.
Types ¶
type RegisterOption ¶
type RegisterOption func(*RegisterOptions)
func RegisterTTL ¶
func RegisterTTL(t time.Duration) RegisterOption
type RegisterOptions ¶
type Registry ¶
type Registry interface { Init(...Option) error Options() Options Register(*Service, ...RegisterOption) error Deregister(*Service) error GetService(string) ([]*Service, error) ListServices() ([]*Service, error) Watch(...WatchOption) (Watcher, error) String() string }
The registry provides an interface for service discovery and an abstraction over varying implementations {consul, etcd, zookeeper, ...}
type Result ¶
Result is returned by a call to Next on the watcher. Actions can be create, update, delete
type WatchOption ¶
type WatchOption func(*WatchOptions)
type WatchOptions ¶
Click to show internal directories.
Click to hide internal directories.