consul

package module
v0.0.0-...-6241a09 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsulRdiscovery

func NewConsulRdiscovery(address string, cfg *consulapi.Config, c rdiscovery.Cache) (rdiscovery.Register, error)

Types

type ConsulRdicovery

type ConsulRdicovery struct {
	// common part
	Address string

	// discovery side part
	EnableCache bool
	// contains filtered or unexported fields
}

func (*ConsulRdicovery) Client

func (c *ConsulRdicovery) Client() (*consulapi.Client, error)

func (*ConsulRdicovery) Close

func (c *ConsulRdicovery) Close()

func (*ConsulRdicovery) Deregister

func (c *ConsulRdicovery) Deregister(node *rdiscovery.ServiceNode) error

func (*ConsulRdicovery) GetService

func (c *ConsulRdicovery) GetService(serviceName string) ([]*rdiscovery.ServiceNode, error)

func (*ConsulRdicovery) Register

func (c *ConsulRdicovery) Register(node *rdiscovery.ServiceNode, opt *rdiscovery.Options) error

type Watcher

type Watcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(client *consulapi.Client, cache rdiscovery.Cache) *Watcher

func (*Watcher) Stop

func (w *Watcher) Stop()

func (*Watcher) Watch

func (w *Watcher) Watch(serviceName string)

func (*Watcher) WatchAllService

func (w *Watcher) WatchAllService() (*watch.Plan, error)

Jump to

Keyboard shortcuts

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