consul

package
v2.1.1-0...-182a82a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 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(serverAddress string) *Consul

New creates a new Consul manager connected to the serverAddress that keeps track of the Consul resolvers.

func (*Consul) Provider

func (c *Consul) Provider() string

func (*Consul) Resolver

func (c *Consul) Resolver(host 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 host 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