consul

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 6 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 {
	GatewayName    string
	GatewayID      string
	GatewayAddress string
	GatewayPort    int
	CAsPool        *x509.CertPool
	CAs            [][]byte
	Services       []Service
}

type ConsulConfig

type ConsulConfig struct {
	// Address is the address of the Consul server
	Address string

	// Scheme is the URI scheme for the Consul server
	Scheme string

	// Datacenter to use. If not provided, the default agent datacenter is used.
	Datacenter string

	// Token is used to provide a per-request ACL token
	// which overrides the agent's default token.
	Token string

	// Namespace is the name of the namespace to send along for the request
	// when no other Namespace ispresent in the QueryOptions
	Namespace string
}

type Instance

type Instance struct {
	ID      string
	Address string
	Port    int
}

type ProxyTLS

type ProxyTLS struct {
	CAFile   string `json:",omitempty"`
	CertFile string `json:",omitempty"`
	KeyFile  string `json:",omitempty"`
	SNI      string `json:",omitempty"`
}

type Service

type Service struct {
	Name       string
	Instances  []*Instance
	Intentions []string
	ProxyTLS   *ProxyTLS
	TLS
}

func NewService

func NewService(svc *service) Service

type TLS

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

func (*TLS) CAsString

func (t *TLS) CAsString() string

func (*TLS) CertString

func (t *TLS) CertString() string

func (*TLS) KeyString

func (t *TLS) KeyString() string

type Watcher

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

Watcher struct for TG config

func New

func New() *Watcher

New Watcher

func (*Watcher) Init

func (w *Watcher) Init(c ConsulConfig, gatewayName string, namespace string) error

func (*Watcher) Reload

func (w *Watcher) Reload()

Reload Configuration

func (*Watcher) Run

func (w *Watcher) Run() error

Run Watcher

Jump to

Keyboard shortcuts

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