Versions in this module Expand all Collapse all v1 v1.0.0 Dec 19, 2018 Changes in this version + const MetaCluster + const MetaColor + const MetaWeight + const MetaZone + var ErrDuplication = errors.New("discovery: instance duplicate registration") + type Builder interface + Build func(id string) Resolver + Scheme func() string + type Config struct + Env string + Host string + Nodes []string + Region string + Zone string + type Discovery struct + func New(c *Config) (d *Discovery) + func (d *Discovery) Build(appid string) Resolver + func (d *Discovery) Close() error + func (d *Discovery) Register(ins *Instance) (cancelFunc context.CancelFunc, err error) + func (d *Discovery) Reload(c *Config) + func (d *Discovery) Scheme() string + func (d *Discovery) Set(ins *Instance) error + type Instance struct + Addrs []string + AppID string + Env string + Hostname string + LastTs int64 + Metadata map[string]string + Region string + Version string + Zone string + type Registry interface + Close func() error + Register func(ins *Instance) (cancel context.CancelFunc, err error) + type Resolve struct + func (r *Resolve) Close() error + func (r *Resolve) Fetch() (ins map[string][]*Instance, ok bool) + func (r *Resolve) Watch() <-chan struct{} + type Resolver interface + Close func() error + Fetch func() (map[string][]*Instance, bool) + Watch func() <-chan struct{}