Documentation ¶ Index ¶ func NewWatcherPlan(service string, params map[string]interface{}, ...) (*watch.Plan, error) type Consul func New(address string) *Consul func (c *Consul) Provider() string func (c *Consul) Resolver(address string) (discovery.Resolver, error) type Watcher func (w *Watcher) Resolve() (string, bool) func (w *Watcher) Run() func (w *Watcher) Stop() Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func NewWatcherPlan ¶ func NewWatcherPlan(service string, params map[string]interface{}, updates chan []discovery.Service) (*watch.Plan, error) Types ¶ type Consul ¶ type Consul struct { // contains filtered or unexported fields } func New ¶ func New(address string) *Consul func (*Consul) Provider ¶ func (c *Consul) Provider() string func (*Consul) Resolver ¶ func (c *Consul) Resolver(address string) (discovery.Resolver, error) Resolver returns a service resolver based on the continuous watcher (*Watcher type), that is subscribed to all the changes related to the service name. The (*Watcher).Resolve() is able to return new service address if the address has been changed. type Watcher ¶ type Watcher struct { *sync.Mutex // contains filtered or unexported fields } func (*Watcher) Resolve ¶ func (w *Watcher) Resolve() (string, bool) func (*Watcher) Run ¶ func (w *Watcher) Run() func (*Watcher) Stop ¶ func (w *Watcher) Stop() Source Files ¶ View all Source files consul.go watcher.go Click to show internal directories. Click to hide internal directories.