Add context options to the runtime
This commit is contained in:
@@ -21,9 +21,9 @@ type Registry interface {
|
||||
Init(...Option) error
|
||||
Options() Options
|
||||
Register(*Service, ...RegisterOption) error
|
||||
Deregister(*Service) error
|
||||
GetService(string) ([]*Service, error)
|
||||
ListServices() ([]*Service, error)
|
||||
Deregister(*Service, ...DeregisterOption) error
|
||||
GetService(string, ...GetOption) ([]*Service, error)
|
||||
ListServices(...ListOption) ([]*Service, error)
|
||||
Watch(...WatchOption) (Watcher, error)
|
||||
String() string
|
||||
}
|
||||
@@ -61,6 +61,12 @@ type RegisterOption func(*RegisterOptions)
|
||||
|
||||
type WatchOption func(*WatchOptions)
|
||||
|
||||
type DeregisterOption func(*DeregisterOptions)
|
||||
|
||||
type GetOption func(*GetOptions)
|
||||
|
||||
type ListOption func(*ListOptions)
|
||||
|
||||
// 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