consul_util

package
v0.0.0-...-276be26 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCACert

func AddCACert(path string, roots *x509.CertPool) *x509.CertPool

func AgentServiceToCatalogService

func AgentServiceToCatalogService(as *api.AgentService, client *api.Client) (*api.CatalogService, error)

func CatalogNodeGetService

func CatalogNodeGetService(cn *api.CatalogNode, serviceName string) *api.AgentService

func Contains

func Contains(s []*api.ServiceEntry, e *api.CatalogService) bool

Contains is a helper function to test if a `api.ServiceEntry` array contains a `api.CatalogService`

func GetCatalog

func GetCatalog(config *store.ConsulConfig) *api.Catalog

func GetClient

func GetClient(config *store.ConsulConfig) *api.Client

func GetConsulApiEntryPoint

func GetConsulApiEntryPoint(registrar *Registrar) *api.CatalogService

func GetConsulConnection

func GetConsulConnection(c *store.ConsulConfig) (client *api.Client, bkup *kvJSON, err error)

func LoadSystemRootCAs

func LoadSystemRootCAs() (systemRoots *x509.CertPool, err error)

func MakeACLClient

func MakeACLClient() *api.Client

func MakeClient

func MakeClient() *api.Client

func MakeClientWithConfig

func MakeClientWithConfig(cb1 configCallback) *api.Client

func NodeToAgent

func NodeToAgent(registrar *Registrar, node string) *api.CatalogNode

func QueryService

func QueryService(name string, catalog *api.Catalog) ([]*api.CatalogService, error)

func QueryServiceByID

func QueryServiceByID(serviceID string, client *api.Client) (res *api.AgentService, err error)

func WaitForResult

func WaitForResult(try testFn, fail errorFn)

Types

type Base

type Base struct {
	FirstClient *api.Client
}

type Registrar

type Registrar struct {
	Base
	Clients       []*api.CatalogService
	CurrentClient *api.CatalogService
}

func GetRegistrar

func GetRegistrar(config *store.ConsulConfig) *Registrar

Jump to

Keyboard shortcuts

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