Documentation
¶
Index ¶
- Variables
- func Deregister(s *regpb.Service) error
- func GetService(name string) ([]*regpb.Service, error)
- func ListServices() ([]*regpb.Service, error)
- func Register(s *regpb.Service, opts ...RegisterOption) error
- func String() string
- type DeregisterOption
- type DeregisterOptions
- type GetOption
- type GetOptions
- type ListOption
- type ListOptions
- type OpenAPIOption
- type OpenAPIOptions
- type Option
- type Options
- type RegisterOption
- type RegisterOptions
- type Registry
- type WatchOption
- type WatchOptions
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultRegistry = NewRegistry() // Not found error when GetService is called ErrNotFound = errors.New("service not found") // Watcher stopped error when watcher is stopped ErrWatcherStopped = errors.New("watcher stopped") )
Functions ¶
func GetService ¶
Retrieve a service. A slice is returned since we separate Name/Version.
func ListServices ¶
List the services. Only returns service names
Types ¶
type DeregisterOption ¶
type DeregisterOption func(*DeregisterOptions)
func DeregisterContext ¶
func DeregisterContext(ctx context.Context) DeregisterOption
type DeregisterOptions ¶
type GetOptions ¶
type ListOption ¶
type ListOption func(*ListOptions)
func ListContext ¶
func ListContext(ctx context.Context) ListOption
type ListOptions ¶
type OpenAPIOption ¶ added in v0.8.0
type OpenAPIOption func(*OpenAPIOptions)
type OpenAPIOptions ¶ added in v0.8.0
type RegisterOption ¶
type RegisterOption func(*RegisterOptions)
func RegisterContext ¶
func RegisterContext(ctx context.Context) RegisterOption
func RegisterTTL ¶
func RegisterTTL(t time.Duration) RegisterOption
type RegisterOptions ¶
type Registry ¶
type Registry interface { Init(...Option) error Options() Options Register(*regpb.Service, ...RegisterOption) error Deregister(*regpb.Service, ...DeregisterOption) error GetService(string, ...GetOption) ([]*regpb.Service, error) ListServices(...ListOption) ([]*regpb.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, ...}
func NewRegistry ¶ added in v0.4.2
NewRegistry returns a new default registry which is mdns
type WatchOption ¶
type WatchOption func(*WatchOptions)
func WatchContext ¶
func WatchContext(ctx context.Context) WatchOption
type WatchOptions ¶
Directories
¶
Path | Synopsis |
---|---|
Package service uses the registry service
|
Package service uses the registry service |
Package mdns provides a multicast dns registry
|
Package mdns provides a multicast dns registry |
Package memory provides an in-memory registry
|
Package memory provides an in-memory registry |
Click to show internal directories.
Click to hide internal directories.