consul

package
v0.0.0-...-3cc3ff2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL