Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeartbeatIntervalSecs = 5 MissedHearbeatTTL = 5 )
View Source
const KeyPrefix = "/discover"
Variables ¶
View Source
var Attempts = attempt.Strategy{ Min: 5, Total: 5 * time.Second, Delay: 200 * time.Millisecond, }
Attempts is the attempt strategy that is used to connect to etcd.
Functions ¶
func ListenAndServe ¶
Types ¶
type Agent ¶
type Agent struct { Backend DiscoveryBackend Address string }
func (*Agent) Unregister ¶
type DiscoveryBackend ¶
type EtcdBackend ¶
func (*EtcdBackend) Register ¶
func (b *EtcdBackend) Register(name, addr string, attrs map[string]string) error
func (*EtcdBackend) Subscribe ¶
func (b *EtcdBackend) Subscribe(name string) (UpdateStream, error)
func (*EtcdBackend) Unregister ¶
func (b *EtcdBackend) Unregister(name, addr string) error
type ServiceUpdate ¶
type UpdateStream ¶
type UpdateStream interface { Chan() chan *ServiceUpdate Close() }
Click to show internal directories.
Click to hide internal directories.