catalog

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectZoneName = "connect.consul"
	ServiceZoneName = "service.consul"
)
View Source
const FlightPathTag = "in-flightpath"

Variables

This section is empty.

Functions

func Hash

func Hash(l []ClusterInfo) string

Types

type Catalog

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

Catalog interacts with consul and keeps a list of currently valid entities

func NewCatalog

func NewCatalog(ctx context.Context, client *api.Client) *Catalog

NewCatalog creates a new instance of Catalog

func (*Catalog) DiscoverClusters

func (c *Catalog) DiscoverClusters(clusters chan<- ClusterInfo, cleanup chan<- string)

DiscoverClusters delivers the state-of-the-world list of clusters as available in the consul catalog.

func (*Catalog) WatchTLS

func (c *Catalog) WatchTLS(service string, cert chan<- TLSInfo)

type CertFinder

type CertFinder interface {
	ConnectCALeaf(string, *api.QueryOptions) (*api.LeafCert, *api.QueryMeta, error)
}

type Cluster

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

func (*Cluster) Endpoints

func (c *Cluster) Endpoints() []Endpoint

func (*Cluster) Hash

func (c *Cluster) Hash() string

func (*Cluster) IsConnectEnabled

func (c *Cluster) IsConnectEnabled() bool

func (*Cluster) Name

func (c *Cluster) Name() string

type ClusterInfo

type ClusterInfo interface {
	Name() string
	Endpoints() []Endpoint
	IsConnectEnabled() bool
	Hash() string
}

ClusterInfo represents a collection of service instances registered in consul catalog. A cluster represents only one type of service.

type Endpoint

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

Endpoint is the network address and port of the service instance.

func (*Endpoint) Addr

func (e *Endpoint) Addr() string

func (*Endpoint) DNSName

func (e *Endpoint) DNSName() string

func (*Endpoint) Name

func (e *Endpoint) Name() string

func (*Endpoint) Port

func (e *Endpoint) Port() int

func (*Endpoint) RoutingInfo

func (e *Endpoint) RoutingInfo() map[string][]string

type Route

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

type RouteFinder

type RouteFinder interface {
	List(string, *api.QueryOptions) (api.KVPairs, *api.QueryMeta, error)
}

type RouteStorage

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

func NewRouteStorage

func NewRouteStorage(ctx context.Context, prefix string, client *api.Client) *RouteStorage

func (*RouteStorage) WatchRoutes

func (i *RouteStorage) WatchRoutes(routes chan<- []Route, errs chan<- error)

type ServiceFinder

type ServiceFinder interface {
	Services(*api.QueryOptions) (map[string][]string, *api.QueryMeta, error)
	Service(string, string, *api.QueryOptions) ([]*api.CatalogService, *api.QueryMeta, error)
}

type TLSInfo

type TLSInfo interface {
	Serial() string
	Cert() string
	PKey() string
	ServiceName() string
}

Jump to

Keyboard shortcuts

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