Documentation
¶
Overview ¶
Package registry is an interface for service discovery
Index ¶
- Constants
- Variables
- func Init(driver string, cfg map[string]interface{}) (err error)
- func Register(name string, r Factory)
- type Cfg
- type DeregOpt
- type DeregOpts
- type Endpoint
- type Event
- type Factory
- type GetOpt
- type GetOpts
- type ListOpt
- type ListOpts
- type Node
- type Nodes
- type Opt
- type Opts
- type RegOpt
- type RegOpts
- type Registry
- type Result
- type Service
- type Value
- type WatchOpt
- type WatchOpts
- type Watcher
Constants ¶
View Source
const DefaultPrefix = "/registry"
Variables ¶
View Source
var Err = xerror.New(Name)
View Source
var ErrNotFound = Err.New("not found")
View Source
var ErrWatcherStopped = Err.New("watcher stopped")
ErrWatcherStopped Watcher stopped error when watcher is stopped
View Source
var Name = "registry"
Functions ¶
Types ¶
type Cfg ¶
type Cfg struct {
Driver string `json:"driver"`
}
func GetDefaultCfg ¶
func GetDefaultCfg() Cfg
type Event ¶
type Event struct { // Id is registry id Id string // Type defines type of event Type types.EventType // Timestamp is event timestamp Timestamp time.Time // Service is registry service Service *Service }
Event is registry event
type Node ¶
type Registry ¶
type Registry interface { String() string Register(*Service, ...RegOpt) error Deregister(*Service, ...DeregOpt) error Watch(string, ...WatchOpt) (Watcher, error) ListService(...ListOpt) ([]*Service, error) GetService(string, ...GetOpt) ([]*Service, error) }
Registry The registry provides an interface for service discovery and an abstraction over varying implementations {consul, etcd, zookeeper, mdns, ...}
type Result ¶
Result is returned by a call to Next on the watcher. Actions can be create, update, delete
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package etcdv3 provides an etcd version 3 registry
|
Package etcdv3 provides an etcd version 3 registry |
Package gossip provides a gossip registry based on hashicorp/memberlist
|
Package gossip provides a gossip registry based on hashicorp/memberlist |
Package mdns is a multicast dns registry
|
Package mdns is a multicast dns registry |
Click to show internal directories.
Click to hide internal directories.