Documentation
¶
Overview ¶
Package file implements service Registry and Discovery using file.
Index ¶
- func New(path 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) (registered gsvc.Service, err error)
- func (r *Registry) Search(ctx context.Context, in gsvc.SearchInput) (result []gsvc.Service, err error)
- func (r *Registry) Watch(ctx context.Context, key string) (watcher gsvc.Watcher, err error)
- type Service
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry implements interface Registry using file. This implement is usually for testing only.
func (*Registry) Deregister ¶
Deregister off-lines and removes `service` from the Registry.
func (*Registry) Register ¶
func (r *Registry) Register(ctx context.Context, service gsvc.Service) (registered gsvc.Service, err error)
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.