Documentation
¶
Overview ¶
Package registry is an interface for service discovery
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
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 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 Service ¶
type Service struct { Protocol string Address string Name string Version string Funcs []string Codecs []string Transport string Side string TLS bool Timestamp int64 Labels map[string]string }
Service register info
type WatchOption ¶
type WatchOption func(*WatchOptions)
type WatchOptions ¶
Click to show internal directories.
Click to hide internal directories.