v1

package
v5.0.1-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//KeyPrefix request path prefix
	KeyPrefix string = "Prefix"
	//KeyHeaders request http headers
	KeyHeaders string = "Headers"
	//KeyDomains request domains
	KeyDomains string = "Domains"
	//KeyMaxConnections The maximum number of connections that Envoy will make to the upstream cluster. If not specified, the default is 1024.
	KeyMaxConnections string = "MaxConnections"
	//KeyMaxPendingRequests The maximum number of pending requests that Envoy will allow to the upstream cluster. If not specified, the default is 1024
	KeyMaxPendingRequests string = "MaxPendingRequests"
	//KeyMaxRequests The maximum number of parallel requests that Envoy will make to the upstream cluster. If not specified, the default is 1024.
	KeyMaxRequests string = "MaxRequests"
	//KeyMaxActiveRetries  The maximum number of parallel retries that Envoy will allow to the upstream cluster. If not specified, the default is 3.
	KeyMaxActiveRetries string = "MaxActiveRetries"
	//KeyUpStream upStream
	KeyUpStream string = "upStream"
	//KeyDownStream downStream
	KeyDownStream string = "downStream"
	//KeyWeight WEIGHT
	KeyWeight string = "Weight"
	//KeyWeightModel MODEL_WEIGHT
	KeyWeightModel string = "weight_model"
	//KeyPrefixModel MODEL_PREFIX
	KeyPrefixModel string = "prefix_model"
	//KeyIntervalMS IntervalMS key
	KeyIntervalMS string = "IntervalMS"
	//KeyConsecutiveErrors ConsecutiveErrors key
	KeyConsecutiveErrors string = "ConsecutiveErrors"
	//KeyBaseEjectionTimeMS BaseEjectionTimeMS key
	KeyBaseEjectionTimeMS string = "BaseEjectionTimeMS"
	//KeyMaxEjectionPercent MaxEjectionPercent key
	KeyMaxEjectionPercent string = "MaxEjectionPercent"
)
View Source
const (
	// DefaultAccessLog is the name of the log channel (stdout in docker environment)
	DefaultAccessLog = "/dev/stdout"

	// DefaultLbType defines the default load balancer policy
	DefaultLbType = LbTypeRoundRobin

	// LDSName is the name of listener-discovery-service (LDS) cluster
	LDSName = "lds"

	// RDSName is the name of route-discovery-service (RDS) cluster
	RDSName = "rds"

	// SDSName is the name of service-discovery-service (SDS) cluster
	SDSName = "sds"

	// CDSName is the name of cluster-discovery-service (CDS) cluster
	CDSName = "cds"

	// RDSAll is the special name for HTTP PROXY route
	RDSAll = "http_proxy"

	// VirtualListenerName is the name for traffic capture listener
	VirtualListenerName = "virtual"

	// ClusterTypeStrictDNS name for clusters of type 'strict_dns'
	ClusterTypeStrictDNS = "strict_dns"

	// ClusterTypeStatic name for clusters of type 'static'
	ClusterTypeStatic = "static"

	// ClusterTypeOriginalDST name for clusters of type 'original_dst'
	ClusterTypeOriginalDST = "original_dst"

	// ClusterTypeSDS name for clusters of type 'sds'
	ClusterTypeSDS = "sds"

	// LbTypeRoundRobin is the name for round-robin LB
	LbTypeRoundRobin = "round_robin"

	// LbTypeLeastRequest is the name for least request LB
	LbTypeLeastRequest = "least_request"

	// LbTypeRingHash is the name for ring hash LB
	LbTypeRingHash = "ring_hash"

	// LbTypeRandom is the name for random LB
	LbTypeRandom = "random"

	// LbTypeOriginalDST is the name for LB of original_dst
	LbTypeOriginalDST = "original_dst_lb"

	// ClusterFeatureHTTP2 is the feature to use HTTP/2 for a cluster
	ClusterFeatureHTTP2 = "http2"

	// HTTPConnectionManager is the name of HTTP filter.
	HTTPConnectionManager = "http_connection_manager"

	// TCPProxyFilter is the name of the TCP Proxy network filter.
	TCPProxyFilter = "tcp_proxy"

	// CORSFilter is the name of the CORS network filter
	CORSFilter = "cors"

	// MongoProxyFilter is the name of the Mongo Proxy network filter.
	MongoProxyFilter = "mongo_proxy"

	// RedisProxyFilter is the name of the Redis Proxy network filter.
	RedisProxyFilter = "redis_proxy"

	// RedisDefaultOpTimeout is the op timeout used for Redis Proxy filter
	// Currently it is set to 30s (conversion happens in the filter)
	// TODO - Allow this to be configured.
	RedisDefaultOpTimeout = 30 * time.Second

	// WildcardAddress binds to all IP addresses
	WildcardAddress = "0.0.0.0"

	// LocalhostAddress for local binding
	LocalhostAddress = "127.0.0.1"

	// EgressTraceOperation denotes the name of trace operation for Envoy
	EgressTraceOperation = "egress"

	// IngressTraceOperation denotes the name of trace operation for Envoy
	IngressTraceOperation = "ingress"

	// ZipkinTraceDriverType denotes the Zipkin HTTP trace driver
	ZipkinTraceDriverType = "zipkin"

	// ZipkinCollectorCluster denotes the cluster where zipkin server is running
	ZipkinCollectorCluster = "zipkin"

	// ZipkinCollectorEndpoint denotes the REST endpoint where Envoy posts Zipkin spans
	ZipkinCollectorEndpoint = "/api/v1/spans"

	// MaxClusterNameLength is the maximum cluster name length
	MaxClusterNameLength = 189 // TODO: use MeshConfig.StatNameLength instead

	// HeaderMethod is the method header.
	HeaderMethod = ":method"
	// HeaderAuthority is the authority header.
	HeaderAuthority = ":authority"
	// HeaderScheme is the scheme header.
	HeaderScheme = ":scheme"
	// MixerFilter name and its attributes
	MixerFilter = "mixer"
)

Variables

View Source
var ListenersALPNProtocols = []string{"h2", "http/1.1"}

ListenersALPNProtocols denotes the the list of ALPN protocols that the listener should expose

NetworkFilterTypes maps filter names to types of structs that implement them. It is used when unmarshaling JSON data. To add your own NetworkFilter types, add additional entries to this map prior to calling json.Unmarshal.

View Source
var (
	// ValidateClusters is an environment variable that can be set to false to disable
	// cluster validation in RDS, in case problems are discovered.
	ValidateClusters = true
)

Functions

func GetOptionValues

func GetOptionValues(kind string, sr map[string]interface{}) interface{}

GetOptionValues get value from options if not exist,return default value

Types

type AbortFilter

type AbortFilter struct {
	Percent    int `json:"abort_percent,omitempty"`
	HTTPStatus int `json:"http_status,omitempty"`
}

AbortFilter definition

type AccessLog

type AccessLog struct {
	Path   string `json:"path"`
	Format string `json:"format,omitempty"`
	Filter string `json:"filter,omitempty"`
}

AccessLog definition.

type Admin

type Admin struct {
	AccessLogPath string `json:"access_log_path"`
	Address       string `json:"address"`
}

Admin definition

type AppendedHeader

type AppendedHeader struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

AppendedHeader definition

type CDSCluter

type CDSCluter struct {
	Clusters Clusters `json:"clusters"`
}

CDSCluter is result struct for cds api

type CORSFilterConfig

type CORSFilterConfig struct{}

CORSFilterConfig definition See: https://www.envoyproxy.io/envoy/configuration/http_filters/cors_filter.html#config-http-filters-cors

func (*CORSFilterConfig) IsNetworkFilterConfig

func (*CORSFilterConfig) IsNetworkFilterConfig()

IsNetworkFilterConfig marks CORSFilterConfig as an implementation of NetworkFilterConfig

type CORSPolicy

type CORSPolicy struct {
	Enabled          bool     `json:"enabled,omitempty"`
	AllowCredentials bool     `json:"allow_credentials,omitempty"`
	AllowMethods     string   `json:"allow_methods,omitempty"`
	AllowHeaders     string   `json:"allow_headers,omitempty"`
	ExposeHeaders    string   `json:"expose_headers,omitempty"`
	MaxAge           int      `json:"max_age,string,omitempty"`
	AllowOrigin      []string `json:"allow_origin,omitempty"`
}

CORSPolicy definition See: https://www.envoyproxy.io/envoy/configuration/http_filters/cors_filter.html#config-http-filters-cors

type Cluster

type Cluster struct {
	Name                     string            `json:"name"`
	ServiceName              string            `json:"service_name,omitempty"`
	ConnectTimeoutMs         int64             `json:"connect_timeout_ms"`
	Type                     string            `json:"type"`
	LbType                   string            `json:"lb_type"`
	MaxRequestsPerConnection int               `json:"max_requests_per_connection,omitempty"`
	Hosts                    []Host            `json:"hosts,omitempty"`
	SSLContext               interface{}       `json:"ssl_context,omitempty"`
	Features                 string            `json:"features,omitempty"`
	CircuitBreaker           *CircuitBreaker   `json:"circuit_breakers,omitempty"`
	OutlierDetection         *OutlierDetection `json:"outlier_detection,omitempty"`
}

Cluster definition

type ClusterManager

type ClusterManager struct {
	Clusters         Clusters          `json:"clusters"`
	SDS              *DiscoveryCluster `json:"sds,omitempty"`
	CDS              *DiscoveryCluster `json:"cds,omitempty"`
	LocalClusterName string            `json:"local_cluster_name,omitempty"`
}

ClusterManager definition

type Clusters

type Clusters []*Cluster

Clusters is a collection of clusters

func (*Clusters) Append

func (c *Clusters) Append(new Clusters)

Append append some clusters

func (Clusters) Normalize

func (c Clusters) Normalize() Clusters

Normalize deduplicates and sorts clusters by name

type Config

type Config struct {
	RootRuntime        *RootRuntime   `json:"runtime,omitempty"`
	Listeners          Listeners      `json:"listeners"`
	LDS                *LDSCluster    `json:"lds,omitempty"`
	Admin              Admin          `json:"admin"`
	ClusterManager     ClusterManager `json:"cluster_manager"`
	StatsdUDPIPAddress string         `json:"statsd_udp_ip_address,omitempty"`
	Tracing            *Tracing       `json:"tracing,omitempty"`

	// Special value used to hash all referenced values (e.g. TLS secrets)
	Hash []byte `json:"-"`
}

Config defines the schema for Envoy JSON configuration format

type Decorator

type Decorator struct {
	Operation string `json:"operation"`
}

Decorator definition

type DefaultCBPriority

type DefaultCBPriority struct {
	MaxConnections     int `json:"max_connections"`
	MaxPendingRequests int `json:"max_pending_requests"`
	MaxRequests        int `json:"max_requests"`
	MaxRetries         int `json:"max_retries"`
}

DefaultCBPriority defines the circuit breaker for default cluster priority

type DelayFilter

type DelayFilter struct {
	Type     string `json:"type,omitempty"`
	Percent  int    `json:"fixed_delay_percent,omitempty"`
	Duration int64  `json:"fixed_duration_ms,omitempty"`
}

DelayFilter definition

type DiscoverHost

type DiscoverHost struct {
	Address string `json:"ip_address"`
	Port    int    `json:"port"`
	Tags    *Tags  `json:"tags,omitempty"`
}

DiscoverHost is hosts that make up the service.

type DiscoverHosts

type DiscoverHosts []*DiscoverHost

DiscoverHosts is a collection of DiscoverHost

type DiscoveryCluster

type DiscoveryCluster struct {
	Cluster        *Cluster `json:"cluster"`
	RefreshDelayMs int64    `json:"refresh_delay_ms"`
}

DiscoveryCluster is a service discovery service definition

type FilterFaultConfig

type FilterFaultConfig struct {
	Abort           *AbortFilter `json:"abort,omitempty"`
	Delay           *DelayFilter `json:"delay,omitempty"`
	Headers         Headers      `json:"headers,omitempty"`
	UpstreamCluster string       `json:"upstream_cluster,omitempty"`
}

FilterFaultConfig definition

type FilterMixerConfig

type FilterMixerConfig struct {
	// DEPRECATED: MixerAttributes specifies the static list of attributes that are sent with
	// each request to Mixer.
	MixerAttributes map[string]string `json:"mixer_attributes,omitempty"`

	// DEPRECATED: ForwardAttributes specifies the list of attribute keys and values that
	// are forwarded as an HTTP header to the server side proxy
	ForwardAttributes map[string]string `json:"forward_attributes,omitempty"`

	// DEPRECATED: QuotaName specifies the name of the quota bucket to withdraw tokens from;
	// an empty name means no quota will be charged.
	QuotaName string `json:"quota_name,omitempty"`

	// DEPRECATED: If set to true, disables mixer check calls for TCP connections
	DisableTCPCheckCalls bool `json:"disable_tcp_check_calls,omitempty"`

	// istio.io/api/mixer/v1/config/client configuration protobuf
	// encoded as a generic map using canonical JSON encoding.
	//
	// If `V2` field is not empty, the DEPRECATED fields above should
	// be discarded.
	V2 map[string]interface{} `json:"v2,omitempty"`
}

FilterMixerConfig definition.

NOTE: all fields marked as DEPRECATED are part of the original v1 mixerclient configuration. They are deprecated and will be eventually removed once proxies are updated.

Going forwards all mixerclient configuration should represeted by istio.io/api/mixer/v1/config/client/mixer_filter_config.proto and encoded in the `V2` field below.

func (*FilterMixerConfig) IsNetworkFilterConfig

func (*FilterMixerConfig) IsNetworkFilterConfig()

IsNetworkFilterConfig marks FilterMixerConfig as an implementation of NetworkFilterConfig

type FilterRouterConfig

type FilterRouterConfig struct {
	// DynamicStats defaults to true
	DynamicStats bool `json:"dynamic_stats,omitempty"`
}

FilterRouterConfig definition

type HTTPFilter

type HTTPFilter struct {
	Type   string      `json:"type"`
	Name   string      `json:"name"`
	Config interface{} `json:"config"`
}

HTTPFilter definition

type HTTPFilterConfig

type HTTPFilterConfig struct {
	CodecType         string                 `json:"codec_type"`
	StatPrefix        string                 `json:"stat_prefix"`
	GenerateRequestID bool                   `json:"generate_request_id,omitempty"`
	UseRemoteAddress  bool                   `json:"use_remote_address,omitempty"`
	Tracing           *HTTPFilterTraceConfig `json:"tracing,omitempty"`
	RouteConfig       *HTTPRouteConfig       `json:"route_config,omitempty"`
	RDS               *RDS                   `json:"rds,omitempty"`
	Filters           []HTTPFilter           `json:"filters"`
	AccessLog         []AccessLog            `json:"access_log,omitempty"`
}

HTTPFilterConfig definition

func (*HTTPFilterConfig) IsNetworkFilterConfig

func (*HTTPFilterConfig) IsNetworkFilterConfig()

IsNetworkFilterConfig marks HTTPFilterConfig as an implementation of NetworkFilterConfig

type HTTPFilterTraceConfig

type HTTPFilterTraceConfig struct {
	OperationName string `json:"operation_name"`
}

HTTPFilterTraceConfig definition

type HTTPRoute

type HTTPRoute struct {
	Runtime *Runtime `json:"runtime,omitempty"`

	Path   string `json:"path,omitempty"`
	Prefix string `json:"prefix,omitempty"`
	Regex  string `json:"regex,omitempty"`

	PrefixRewrite string `json:"prefix_rewrite,omitempty"`
	HostRewrite   string `json:"host_rewrite,omitempty"`

	PathRedirect string `json:"path_redirect,omitempty"`
	HostRedirect string `json:"host_redirect,omitempty"`

	Cluster          string           `json:"cluster,omitempty"`
	WeightedClusters *WeightedCluster `json:"weighted_clusters,omitempty"`

	Headers      Headers           `json:"headers,omitempty"`
	TimeoutMS    int64             `json:"timeout_ms"`
	RetryPolicy  *RetryPolicy      `json:"retry_policy,omitempty"`
	OpaqueConfig map[string]string `json:"opaque_config,omitempty"`

	AutoHostRewrite  bool `json:"auto_host_rewrite,omitempty"`
	WebsocketUpgrade bool `json:"use_websocket,omitempty"`

	ShadowCluster *ShadowCluster `json:"shadow,omitempty"`

	HeadersToAdd []AppendedHeader `json:"request_headers_to_add,omitempty"`

	CORSPolicy *CORSPolicy `json:"cors,omitempty"`

	Decorator *Decorator `json:"decorator,omitempty"`

	// clusters contains the set of referenced clusters in the route; the field is special
	// and used only to aggregate cluster information after composing routes
	Clusters Clusters `json:"-"`
	// contains filtered or unexported fields
}

HTTPRoute definition

func (*HTTPRoute) BasicHash

func (route *HTTPRoute) BasicHash() string

BasicHash returns hash string by route path\prefix\header

func (*HTTPRoute) CatchAll

func (route *HTTPRoute) CatchAll() bool

CatchAll returns true if the route matches all requests

func (*HTTPRoute) CombinePathPrefix

func (route *HTTPRoute) CombinePathPrefix(path, prefix string) *HTTPRoute

CombinePathPrefix checks that the route applies for a given path and prefix match and updates the path and the prefix in the route. If the route is incompatible with the path or the prefix, returns nil. Either path or prefix must be set but not both. The resulting route must match exactly the requests that match both the original route and the supplied path and prefix.

func (*HTTPRoute) Redirect

func (route *HTTPRoute) Redirect() bool

Redirect returns true if route contains redirect logic

type HTTPRouteConfig

type HTTPRouteConfig struct {
	ValidateClusters bool           `json:"validate_clusters"`
	VirtualHosts     []*VirtualHost `json:"virtual_hosts"`
}

HTTPRouteConfig definition

func (*HTTPRouteConfig) Clusters

func (rc *HTTPRouteConfig) Clusters() Clusters

Clusters returns the clusters for the given route config.

func (*HTTPRouteConfig) Normalize

func (rc *HTTPRouteConfig) Normalize() *HTTPRouteConfig

Normalize normalizes the route config.

type HTTPRouteConfigs

type HTTPRouteConfigs map[int]*HTTPRouteConfig

HTTPRouteConfigs is a map from the port number to the route config

func (HTTPRouteConfigs) Clusters

func (routes HTTPRouteConfigs) Clusters() Clusters

Clusters returns the clusters corresponding to the given routes.

func (HTTPRouteConfigs) Combine

func (routes HTTPRouteConfigs) Combine() *HTTPRouteConfig

Combine creates a new route config that is the union of all HTTP routes. note that the virtual hosts without an explicit port suffix (IP:PORT) are stripped for all routes except the route for port 80.

func (HTTPRouteConfigs) EnsurePort

func (routes HTTPRouteConfigs) EnsurePort(port int) *HTTPRouteConfig

EnsurePort creates a route config if necessary

func (HTTPRouteConfigs) Normalize

func (routes HTTPRouteConfigs) Normalize() HTTPRouteConfigs

Normalize normalizes the route configs.

type HTTPTraceDriver

type HTTPTraceDriver struct {
	HTTPTraceDriverType   string                `json:"type"`
	HTTPTraceDriverConfig HTTPTraceDriverConfig `json:"config"`
}

HTTPTraceDriver definition

type HTTPTraceDriverConfig

type HTTPTraceDriverConfig struct {
	CollectorCluster  string `json:"collector_cluster"`
	CollectorEndpoint string `json:"collector_endpoint"`
}

HTTPTraceDriverConfig definition

type HTTPTracer

type HTTPTracer struct {
	HTTPTraceDriver HTTPTraceDriver `json:"driver"`
}

HTTPTracer definition

type Header struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Regex bool   `json:"regex,omitempty"`
}

Header definition

type Headers

type Headers []Header

Headers sorts headers

func (Headers) Len

func (s Headers) Len() int

func (Headers) Less

func (s Headers) Less(i, j int) bool

func (Headers) Swap

func (s Headers) Swap(i, j int)

type Host

type Host struct {
	URL string `json:"url"`
}

Host definition

type LDSCluster

type LDSCluster struct {
	Cluster        string `json:"cluster"`
	RefreshDelayMs int64  `json:"refresh_delay_ms"`
}

LDSCluster is a reference to LDS cluster by name

type LDSListener

type LDSListener struct {
	Listeners Listeners `json:"listeners"`
}

LDSListener is result struct for lds api

type Listener

type Listener struct {
	Address        string           `json:"address"`
	Name           string           `json:"name,omitempty"`
	Filters        []*NetworkFilter `json:"filters"`
	SSLContext     *SSLContext      `json:"ssl_context,omitempty"`
	BindToPort     bool             `json:"bind_to_port"`
	UseOriginalDst bool             `json:"use_original_dst,omitempty"`
}

Listener definition

func CreateHTTPCommonListener

func CreateHTTPCommonListener(name string, vh ...*VirtualHost) *Listener

CreateHTTPCommonListener create simple http common listener listen port 80

func CreateTCPCommonListener

func CreateTCPCommonListener(listenerName, clusterName string, address string) *Listener

CreateTCPCommonListener create tcp simple common listener listen the specified port associate the specified cluster.

type Listeners

type Listeners []*Listener

Listeners is a collection of listeners

func (*Listeners) Append

func (l *Listeners) Append(new Listeners)

Append append some listeners

func (Listeners) GetByAddress

func (listeners Listeners) GetByAddress(addr string) *Listener

GetByAddress returns a listener by its address

type MongoProxyFilterConfig

type MongoProxyFilterConfig struct {
	StatPrefix string `json:"stat_prefix"`
}

MongoProxyFilterConfig definition

func (*MongoProxyFilterConfig) IsNetworkFilterConfig

func (*MongoProxyFilterConfig) IsNetworkFilterConfig()

IsNetworkFilterConfig marks MongoProxyFilterConfig as an implementation of NetworkFilterConfig

type NetworkFilter

type NetworkFilter struct {
	Type   string              `json:"-"`
	Name   string              `json:"name"`
	Config NetworkFilterConfig `json:"config"`
}

NetworkFilter definition

func (*NetworkFilter) UnmarshalJSON

func (nf *NetworkFilter) UnmarshalJSON(b []byte) error

UnmarshalJSON handles custom unmarshal logic for the NetworkFilter struct. This is needed because the config field depends on the filter name.

type NetworkFilterConfig

type NetworkFilterConfig interface {
	IsNetworkFilterConfig()
}

NetworkFilterConfig is a marker interface

type OutlierDetection

type OutlierDetection struct {
	ConsecutiveErrors  int   `json:"consecutive_5xx,omitempty"`
	IntervalMS         int64 `json:"interval_ms,omitempty"`
	BaseEjectionTimeMS int64 `json:"base_ejection_time_ms,omitempty"`
	MaxEjectionPercent int   `json:"max_ejection_percent,omitempty"`
}

OutlierDetection definition See: https://lyft.github.io/envoy/docs/configuration/cluster_manager/cluster_runtime.html#outlier-detection

type RDS

type RDS struct {
	Cluster         string `json:"cluster"`
	RouteConfigName string `json:"route_config_name"`
	RefreshDelayMs  int64  `json:"refresh_delay_ms"`
}

RDS definition

type RedisConnPool

type RedisConnPool struct {
	OperationTimeoutMS int64 `json:"op_timeout_ms"`
}

RedisConnPool definition

type RedisProxyFilterConfig

type RedisProxyFilterConfig struct {
	ClusterName string         `json:"cluster_name"`
	ConnPool    *RedisConnPool `json:"conn_pool"`
	StatPrefix  string         `json:"stat_prefix"`
}

RedisProxyFilterConfig definition

func (*RedisProxyFilterConfig) IsNetworkFilterConfig

func (*RedisProxyFilterConfig) IsNetworkFilterConfig()

IsNetworkFilterConfig marks RedisProxyFilterConfig as an implementation of NetworkFilterConfig

type RetryPolicy

type RetryPolicy struct {
	Policy          string `json:"retry_on"` //if unset, set to 5xx,connect-failure,refused-stream
	NumRetries      int    `json:"num_retries,omitempty"`
	PerTryTimeoutMS int64  `json:"per_try_timeout_ms,omitempty"`
}

RetryPolicy definition See: https://lyft.github.io/envoy/docs/configuration/http_conn_man/route_config/route.html#retry-policy

type RootRuntime

type RootRuntime struct {
	SymlinkRoot          string `json:"symlink_root"`
	Subdirectory         string `json:"subdirectory"`
	OverrideSubdirectory string `json:"override_subdirectory,omitempty"`
}

RootRuntime definition. See https://envoyproxy.github.io/envoy/configuration/overview/overview.html

type RoutesByPath

type RoutesByPath []*HTTPRoute

RoutesByPath sorts routes by their path and/or prefix, such that: - Exact path routes are "less than" than prefix path routes - Exact path routes are sorted lexicographically - Prefix path routes are sorted anti-lexicographically

This order ensures that prefix path routes do not shadow more specific routes which share the same prefix.

func (RoutesByPath) Len

func (r RoutesByPath) Len() int

func (RoutesByPath) Less

func (r RoutesByPath) Less(i, j int) bool

func (RoutesByPath) Swap

func (r RoutesByPath) Swap(i, j int)

type Runtime

type Runtime struct {
	Key     string `json:"key"`
	Default int    `json:"default"`
}

Runtime definition

type SDSHost

type SDSHost struct {
	Hosts DiscoverHosts `json:"hosts"`
}

SDSHost is result struct for sds api

type SSLContext

type SSLContext struct {
	CertChainFile            string `json:"cert_chain_file"`
	PrivateKeyFile           string `json:"private_key_file"`
	CaCertFile               string `json:"ca_cert_file,omitempty"`
	RequireClientCertificate bool   `json:"require_client_certificate"`
	ALPNProtocols            string `json:"alpn_protocols,omitempty"`
}

SSLContext definition

type SSLContextExternal

type SSLContextExternal struct {
	CaCertFile string `json:"ca_cert_file,omitempty"`
}

SSLContextExternal definition

type SSLContextWithSAN

type SSLContextWithSAN struct {
	CertChainFile        string   `json:"cert_chain_file"`
	PrivateKeyFile       string   `json:"private_key_file"`
	CaCertFile           string   `json:"ca_cert_file,omitempty"`
	VerifySubjectAltName []string `json:"verify_subject_alt_name"`
}

SSLContextWithSAN definition, VerifySubjectAltName cannot be nil.

type ShadowCluster

type ShadowCluster struct {
	Cluster string `json:"cluster"`
}

ShadowCluster definition See: https://www.envoyproxy.io/envoy/configuration/http_conn_man/route_config/route.html? highlight=shadow#config-http-conn-man-route-table-route-shadow

type TCPProxyFilterConfig

type TCPProxyFilterConfig struct {
	StatPrefix  string          `json:"stat_prefix"`
	RouteConfig *TCPRouteConfig `json:"route_config"`
}

TCPProxyFilterConfig definition

func (*TCPProxyFilterConfig) IsNetworkFilterConfig

func (*TCPProxyFilterConfig) IsNetworkFilterConfig()

IsNetworkFilterConfig marks TCPProxyFilterConfig as an implementation of NetworkFilterConfig

type TCPRoute

type TCPRoute struct {
	Cluster           string   `json:"cluster"`
	DestinationIPList []string `json:"destination_ip_list,omitempty"`
	DestinationPorts  string   `json:"destination_ports,omitempty"`
	SourceIPList      []string `json:"source_ip_list,omitempty"`
	SourcePorts       string   `json:"source_ports,omitempty"`
	// contains filtered or unexported fields
}

TCPRoute definition

type TCPRouteByRoute

type TCPRouteByRoute []*TCPRoute

TCPRouteByRoute sorts TCP routes over all route sub fields.

func (TCPRouteByRoute) Len

func (r TCPRouteByRoute) Len() int

func (TCPRouteByRoute) Less

func (r TCPRouteByRoute) Less(i, j int) bool

func (TCPRouteByRoute) Swap

func (r TCPRouteByRoute) Swap(i, j int)

type TCPRouteConfig

type TCPRouteConfig struct {
	Routes []*TCPRoute `json:"routes"`
}

TCPRouteConfig (or generalize as RouteConfig or L4RouteConfig for TCP/UDP?)

type Tags

type Tags struct {
	AZ     string `json:"az,omitempty"`
	Canary bool   `json:"canary,omitempty"`

	// Weight is an integer in the range [1, 100] or empty
	Weight int `json:"load_balancing_weight,omitempty"`
}

Tags is Discover host tags

type Tracing

type Tracing struct {
	HTTPTracer HTTPTracer `json:"http"`
}

Tracing definition

type VirtualHost

type VirtualHost struct {
	Name    string       `json:"name"`
	Domains []string     `json:"domains"`
	Routes  []*HTTPRoute `json:"routes"`
}

VirtualHost definition

func UniqVirtualHost

func UniqVirtualHost(vhs []*VirtualHost) (revhs []*VirtualHost)

UniqVirtualHost according to the rules of VirtualHost in http route merge the VirtualHost that have same domain if have same domain, prifix, path and header,support weight

type WeightedCluster

type WeightedCluster struct {
	Clusters         []*WeightedClusterEntry `json:"clusters"`
	RuntimeKeyPrefix string                  `json:"runtime_key_prefix,omitempty"`
}

WeightedCluster definition See https://envoyproxy.github.io/envoy/configuration/http_conn_man/route_config/route.html

type WeightedClusterEntry

type WeightedClusterEntry struct {
	Name   string `json:"name"`
	Weight int    `json:"weight"`
}

WeightedClusterEntry definition. Describes the format of each entry in the WeightedCluster

Jump to

Keyboard shortcuts

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