consul

package
v0.0.0-...-4a28188 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConsulClient

func GetConsulClient() (*capi.Client, error)

GetConsulClient will return consul client

Types

type Controller

type Controller interface {
	Watch(ctx context.Context, mutexCache *sync.RWMutex, consulChange map[string]int,
		consulCalico map[string]string, serviceMap map[string][]*capi.CatalogService, stop chan os.Signal)
}

Controller defines the interface for a controller

type ControllerFake

type ControllerFake struct{}

ControllerFake fakes the consul controller

func (*ControllerFake) Watch

func (c *ControllerFake) Watch(ctx context.Context, mutexCache *sync.RWMutex, consulChange map[string]int,
	consulCalico map[string]string, serviceMap map[string][]*capi.CatalogService, stop chan os.Signal)

Watch gets a list of consul services and runs a sync for each consul service

type ControllerImpl

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

ControllerImpl is used to interact with consul

func New

func New(c *capi.Client) *ControllerImpl

New returns new ControllerImpl object

func (*ControllerImpl) Watch

func (c *ControllerImpl) Watch(ctx context.Context, mutexCache *sync.RWMutex, consulChange map[string]int,
	consulCalico map[string]string, serviceMap map[string][]*capi.CatalogService, stop chan os.Signal)

Watch gets a list of consul services and runs a watch for each consul service

Jump to

Keyboard shortcuts

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