envoy

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayPrefix prefix annotation
	GatewayPrefix = "gateway.appmesh.k8s.aws/"
	// GatewayExpose expose boolean annotation
	GatewayExpose = GatewayPrefix + "expose"
	// GatewayDomain annotation with a comma separated list of public or internal domains
	GatewayDomain = GatewayPrefix + "domain"
	// GatewayTimeout max response duration annotation
	GatewayTimeout = GatewayPrefix + "timeout"
	// GatewayRetries number of retries annotation
	GatewayRetries = GatewayPrefix + "retries"
	// GatewayPrimary primary virtual service name annotation
	GatewayPrimary = GatewayPrefix + "primary"
	// GatewayCanary canary virtual service name annotation
	GatewayCanary = GatewayPrefix + "canary"
	// GatewayCanaryWeight traffic weight percentage annotation
	GatewayCanaryWeight = GatewayPrefix + "canary-weight"
)

Variables

This section is empty.

Functions

func NewCache

func NewCache(ads bool) cache.SnapshotCache

NewCache creates an Envoy cache

Types

type Canary

type Canary struct {
	PrimaryCluster string `json:"primaryCluster"`
	CanaryCluster  string `json:"canaryCluster"`
	CanaryWeight   int    `json:"canaryWeight"`
}

Canary is a compact form of an Envoy weighted cluster

func CanaryFromAnnotations

func CanaryFromAnnotations(an map[string]string) *Canary

CanaryFromAnnotations parses the annotations and returns a canary object

type Hasher

type Hasher struct{}

Hasher computes string identifiers for Envoy nodes.

func (Hasher) ID

func (h Hasher) ID(node *envoycore.Node) string

ID returns the Envoy node ID

type Snapshot

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

Snapshot manages Envoy clusters and listeners cache snapshots

func NewSnapshot

func NewSnapshot(cache cache.SnapshotCache) *Snapshot

NewSnapshot creates an Envoy cache snapshot manager

func (*Snapshot) Delete

func (s *Snapshot) Delete(key string)

Delete removes an upstream from the in-memory cache

func (*Snapshot) Len

func (s *Snapshot) Len() int

Len returns the number of upstreams stored in the in-memory cache

func (*Snapshot) Store

func (s *Snapshot) Store(key string, value Upstream)

Store inserts or updates an upstream in the in-memory cache

func (*Snapshot) Sync

func (s *Snapshot) Sync() error

Sync reconciles the in-memory cache of upstreams with the Envoy cache by creating a new snapshot

type Upstream

type Upstream struct {
	Name     string        `json:"name"`
	Host     string        `json:"host"`
	Port     uint32        `json:"port"`
	PortName string        `json:"portName"`
	Domains  []string      `json:"domains"`
	Prefix   string        `json:"prefix"`
	Retries  uint32        `json:"retries"`
	Timeout  time.Duration `json:"timeout"`
	Canary   *Canary       `json:"canary"`
}

Upstream is a compact form of an Envoy cluster and virtual host

Jump to

Keyboard shortcuts

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