consulwatch

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CARoot

type CARoot struct {
	ID     string `json:",omitempty"`
	Name   string `json:",omitempty"`
	PEM    string `json:",omitempty"`
	Active bool
}

type CARoots

type CARoots struct {
	ActiveRootID string
	TrustDomain  string
	Roots        map[string]CARoot
}

type Certificate

type Certificate struct {
	SerialNumber  string    `json:",omitempty"`
	PEM           string    `json:",omitempty"`
	PrivateKeyPEM string    `json:",omitempty"`
	Service       string    `json:",omitempty"`
	ServiceURI    string    `json:",omitempty"`
	ValidAfter    time.Time `json:",omitempty"`
	ValidBefore   time.Time `json:",omitempty"`
}

type ConnectCARootsWatcher

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

ConnectCARootsWatcher watches the Consul Connect CA roots endpoint for changes and invokes a a handler function whenever it changes.

func NewConnectCARootsWatcher

func NewConnectCARootsWatcher(consul *api.Client, logger *log.Logger) (*ConnectCARootsWatcher, error)

func (*ConnectCARootsWatcher) Start

func (w *ConnectCARootsWatcher) Start() error

func (*ConnectCARootsWatcher) Stop

func (w *ConnectCARootsWatcher) Stop()

func (*ConnectCARootsWatcher) Watch

func (w *ConnectCARootsWatcher) Watch(handler func(*CARoots, error))

type ConnectLeafWatcher

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

func NewConnectLeafWatcher

func NewConnectLeafWatcher(consul *api.Client, logger *log.Logger, service string) (*ConnectLeafWatcher, error)

func (*ConnectLeafWatcher) Start

func (w *ConnectLeafWatcher) Start() error

func (*ConnectLeafWatcher) Stop

func (w *ConnectLeafWatcher) Stop()

func (*ConnectLeafWatcher) Watch

func (w *ConnectLeafWatcher) Watch(handler func(*Certificate, error))

type Endpoint

type Endpoint struct {
	SystemID string   `json:""`
	ID       string   `json:""`
	Service  string   `json:""`
	Address  string   `json:""`
	Port     int      `json:""`
	Tags     []string `json:""`
}

type Endpoints

type Endpoints struct {
	Id        string     `json:""`
	Service   string     `json:""`
	Endpoints []Endpoint `json:""`
}

Endpoints contains an Array of Endpoint structs and meta information about the Service that the contained endpoints are associated with.

func (*Endpoints) GroupByTags

func (e *Endpoints) GroupByTags() map[string][]Endpoint

GroupByTags returns a map of tag name to array of Endpoint structs.

type ServiceWatcher

type ServiceWatcher struct {
	ServiceName string
	// contains filtered or unexported fields
}

func New

func New(client *consulapi.Client, logger *log.Logger, datacenter string, service string, onlyHealthy bool) (*ServiceWatcher, error)

func (*ServiceWatcher) Start

func (w *ServiceWatcher) Start() error

func (*ServiceWatcher) Stop

func (w *ServiceWatcher) Stop()

func (*ServiceWatcher) Watch

func (w *ServiceWatcher) Watch(handler func(endpoints Endpoints, err error))

Jump to

Keyboard shortcuts

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