consul

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName string
	ServiceID   string
	CAsPool     *x509.CertPool
	Downstream  Downstream
	Upstreams   []Upstream
}

type Downstream

type Downstream struct {
	LocalBindAddress string
	LocalBindPort    int
	TargetAddress    string
	TargetPort       int

	TLS
}

func (Downstream) Equal

func (d Downstream) Equal(o Downstream) bool

type TLS

type TLS struct {
	Cert []byte
	Key  []byte
	CAs  [][]byte
}

func (TLS) Equal

func (t TLS) Equal(o TLS) bool

type Upstream

type Upstream struct {
	Service          string
	LocalBindAddress string
	LocalBindPort    int

	TLS

	Nodes []UpstreamNode
}

func (Upstream) Equal

func (n Upstream) Equal(o Upstream) bool

type UpstreamNode

type UpstreamNode struct {
	Host   string
	Port   int
	Weight int
}

func (UpstreamNode) Equal

func (n UpstreamNode) Equal(o UpstreamNode) bool

func (UpstreamNode) ID

func (n UpstreamNode) ID() string

type Watcher

type Watcher struct {
	C chan Config
	// contains filtered or unexported fields
}

func New

func New(service string, consul *api.Client) *Watcher

func (*Watcher) Run

func (w *Watcher) Run() error

Jump to

Keyboard shortcuts

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