consul

package
v0.0.0-...-6b63850 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller communicates with Consul and monitors for changes

func NewController

func NewController(addr string) (*Controller, error)

NewController creates a new Consul controller

func (*Controller) AppendServiceChangeHandler

func (c *Controller) AppendServiceChangeHandler(serviceChanged func())

AppendServiceHandler implements a service catalog operation

func (*Controller) Run

func (c *Controller) Run(stop <-chan struct{})

Run until a stop signal is received

func (*Controller) ServiceChanged

func (c *Controller) ServiceChanged() error

func (*Controller) ServiceEntries

func (c *Controller) ServiceEntries() ([]*istio.ServiceEntry, error)

Services list declarations of all services in the system

type Monitor

type Monitor interface {
	Start(<-chan struct{})
	AppendServiceChangeHandler(ServiceChangeHandler)
}

Monitor handles service and instance changes

func NewConsulMonitor

func NewConsulMonitor(client *api.Client) Monitor

NewConsulMonitor watches for changes in Consul services and CatalogServices

type ServiceChangeHandler

type ServiceChangeHandler func() error

ServiceChangeHandler processes service change events It's just a notification, we don't need to pass the changed services

Jump to

Keyboard shortcuts

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