Documentation ¶
Index ¶
- Variables
- func RegisterResolver(r Registry, opts ...ResolverOption)
- type DeregisterOption
- type DeregisterOptions
- type Event
- type EventType
- type GetOption
- type GetOptions
- type ListOption
- type ListOptions
- type Node
- type Option
- type Options
- type RegisterOption
- type RegisterOptions
- type Registry
- type ResolverOption
- type ResolverOptions
- type Result
- type Service
- type WatchOption
- type WatchOptions
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultScheme = "etcd" DefaultTimeOut = time.Second * 5 )
View Source
var ( DefaultRegistry = NewRegistry() // Not found error when GetService is called ErrNotFound = errors.New("service not found") )
Functions ¶
func RegisterResolver ¶
func RegisterResolver(r Registry, opts ...ResolverOption)
Types ¶
type DeregisterOption ¶
type DeregisterOption func(*DeregisterOptions)
func DeregisterContext ¶
func DeregisterContext(ctx context.Context) DeregisterOption
type DeregisterOptions ¶
type Event ¶
type Event struct { // Id is registry id Id string // Type defines type of event Type EventType // Timestamp is event timestamp Timestamp time.Time // Service is registry service Service *Service }
Event is registry event
type GetOptions ¶
type ListOption ¶
type ListOption func(*ListOptions)
func ListContext ¶
func ListContext(ctx context.Context) ListOption
type ListOptions ¶
type RegisterOption ¶
type RegisterOption func(*RegisterOptions)
func RegisterContext ¶
func RegisterContext(ctx context.Context) RegisterOption
func RegisterTTL ¶
func RegisterTTL(t time.Duration) RegisterOption
type Registry ¶
type Registry interface { Init(...Option) error Options() Options Register(*Service, ...RegisterOption) error Deregister(*Service, ...DeregisterOption) error GetService(string, ...GetOption) ([]*Service, error) ListServices(...ListOption) ([]*Service, error) Watch(...WatchOption) (Watcher, error) String() string }
func NewRegistry ¶
type ResolverOption ¶
type ResolverOption func(*ResolverOptions)
func ResolverScheme ¶
func ResolverScheme(scheme string) ResolverOption
func ResolverService ¶
func ResolverService(service string) ResolverOption
type ResolverOptions ¶
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 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.