Documentation
¶
Overview ¶
Package redis implements service Registry and Discovery using redis.
Index ¶
- Constants
- func New(group string) gsvc.Registry
- type Registry
- func (r *Registry) Deregister(ctx context.Context, service gsvc.Service) error
- func (r *Registry) Register(ctx context.Context, service gsvc.Service) (gsvc.Service, error)
- func (r *Registry) Search(ctx context.Context, in gsvc.SearchInput) ([]gsvc.Service, error)
- func (r *Registry) Watch(ctx context.Context, key string) (gsvc.Watcher, error)
- type Service
Constants ¶
View Source
const ( // DefaultKeepAliveTTL is the default keepalive TTL. DefaultKeepAliveTTL = 10 // time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Registry ¶
type Registry struct {
Group string
}
Registry implements gsvc.Registry interface.
func (*Registry) Deregister ¶
Deregister off-lines and removes `service` from the Registry.
func (*Registry) Register ¶
Register registers `service` to Registry. Note that it returns a new Service if it changes the input Service with custom one.
type Service ¶
Service wrapper.
func NewService ¶
NewService creates and returns local Service from gsvc.Service interface object.
func (*Service) GetEndpoints ¶
GetEndpoints returns the Endpoints of service. The Endpoints contain multiple host/port information of service.
func (*Service) GetMetadata ¶
GetMetadata returns the Metadata map of service. The Metadata is key-value pair map specifying extra attributes of a service.
Click to show internal directories.
Click to hide internal directories.