Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAddress(bind string, port uint32) core.Address
- func BuildConfigInfoMetadata(config model.ConfigMeta) *core.Metadata
- func CloneCluster(cluster *xdsapi.Cluster) xdsapi.Cluster
- func CloneClusterLoadAssignment(original *xdsapi.ClusterLoadAssignment) xdsapi.ClusterLoadAssignment
- func ConvertAddressToCidr(addr string) *core.CidrRange
- func ConvertLocality(locality string) *core.Locality
- func GetByAddress(listeners []*xdsapi.Listener, addr string) *xdsapi.Listener
- func GetNetworkEndpointAddress(n *model.NetworkEndpoint) core.Address
- func GogoDurationToDuration(d *types.Duration) time.Duration
- func IsHTTPFilterChain(filterChain listener.FilterChain) bool
- func IsLocalityEmpty(locality *core.Locality) bool
- func IsProxyVersionGE11(node *model.Proxy) bool
- func IsXDSMarshalingToAnyEnabled(node *model.Proxy) bool
- func LbPriority(proxyLocality, endpointsLocality *core.Locality) int
- func LocalityLbWeightNormalize(endpoints []endpoint.LocalityLbEndpoints) []endpoint.LocalityLbEndpoints
- func LocalityMatch(proxyLocality *core.Locality, ruleLocality string) bool
- func MessageToAny(msg proto.Message) *types.Any
- func MessageToStruct(msg proto.Message) *types.Struct
- func ResolveHostsInNetworksConfig(config *meshconfig.MeshNetworks)
- func SortVirtualHosts(hosts []route.VirtualHost)
- func SplitLocality(locality string) (region, zone, subzone string)
Constants ¶
const ( // BlackHoleCluster to catch traffic from routes with unresolved clusters. Traffic arriving here goes nowhere. BlackHoleCluster = "BlackHoleCluster" // PassthroughCluster to forward traffic to the original destination requested. This cluster is used when // traffic does not match any listener in envoy. PassthroughCluster = "PassthroughCluster" // SniClusterFilter is the name of the sni_cluster envoy filter SniClusterFilter = "envoy.filters.network.sni_cluster" // NoProxyLocality represents the locality associated with a proxy that doesn't have locality settings // since all our localities are in region/zone/subzone format, the empty locality will be of form // '///' NoProxyLocality = "///" // IstioMetadataKey is the key under which metadata is added to a route or cluster // regarding the virtual service or destination rule used for each IstioMetadataKey = "istio" )
Variables ¶
var ALPNH2Only = []string{"h2"}
ALPNH2Only advertises that Proxy is going to use HTTP/2 when talking to the cluster.
var ALPNHttp = []string{"h2", "http/1.1"}
ALPNHttp advertises that Proxy is going to talking either http2 or http 1.1.
var ALPNInMesh = []string{"istio"}
ALPNInMesh advertises that Proxy is going to talk to the in-mesh cluster. The custom "istio" value indicates in-mesh traffic and it's going to be used for routing decisions.
var ALPNInMeshH2 = []string{"istio", "h2"}
ALPNInMeshH2 advertises that Proxy is going to use HTTP/2 when talking to the in-mesh cluster. The custom "istio" value indicates in-mesh traffic and it's going to be used for routing decisions. Once Envoy supports client-side ALPN negotiation, this should be {"istio", "h2", "http/1.1"}.
Functions ¶
func BuildAddress ¶
BuildAddress returns a SocketAddress with the given ip and port or uds.
func BuildConfigInfoMetadata ¶
func BuildConfigInfoMetadata(config model.ConfigMeta) *core.Metadata
BuildConfigInfoMetadata builds core.Metadata struct containing the name.namespace of the config, the type, etc. Used by Mixer client to generate attributes for policy and telemetry.
func CloneCluster ¶
return a shallow copy cluster
func CloneClusterLoadAssignment ¶
func CloneClusterLoadAssignment(original *xdsapi.ClusterLoadAssignment) xdsapi.ClusterLoadAssignment
return a shallow copy ClusterLoadAssignment
func ConvertAddressToCidr ¶
ConvertAddressToCidr converts from string to CIDR proto
func ConvertLocality ¶
ConvertLocality converts '/' separated locality string to Locality struct.
func GetByAddress ¶
GetByAddress returns a listener by its address TODO(mostrowski): consider passing map around to save iteration.
func GetNetworkEndpointAddress ¶
func GetNetworkEndpointAddress(n *model.NetworkEndpoint) core.Address
GetNetworkEndpointAddress returns an Envoy v2 API `Address` that represents this NetworkEndpoint
func GogoDurationToDuration ¶
GogoDurationToDuration converts from gogo proto duration to time.duration
func IsHTTPFilterChain ¶
func IsHTTPFilterChain(filterChain listener.FilterChain) bool
IsHTTPFilterChain returns true if the filter chain contains a HTTP connection manager filter
func IsLocalityEmpty ¶
IsLocalityEmpty checks if a locality is empty (checking region is good enough, based on how its initialized)
func IsProxyVersionGE11 ¶
IsProxyVersionGE11 checks whether the given Proxy version is greater than or equals 1.1.
func IsXDSMarshalingToAnyEnabled ¶
IsXDSMarshalingToAnyEnabled controls whether "marshaling to Any" feature is enabled.
func LbPriority ¶
func LocalityLbWeightNormalize ¶
func LocalityLbWeightNormalize(endpoints []endpoint.LocalityLbEndpoints) []endpoint.LocalityLbEndpoints
LocalityLbWeightNormalize set LocalityLbEndpoints within a cluster with a valid LoadBalancingWeight.
func MessageToAny ¶
MessageToAny converts from proto message to proto Any
func MessageToStruct ¶
MessageToStruct converts from proto message to proto Struct
func ResolveHostsInNetworksConfig ¶
func ResolveHostsInNetworksConfig(config *meshconfig.MeshNetworks)
ResolveHostsInNetworksConfig will go through the Gateways addresses for all networks in the config and if it's not an IP address it will try to lookup that hostname and replace it with the IP address in the config
func SortVirtualHosts ¶
func SortVirtualHosts(hosts []route.VirtualHost)
SortVirtualHosts sorts a slice of virtual hosts by name.
Envoy computes a hash of RDS to see if things have changed - hash is affected by order of elements in the filter. Therefore we sort virtual hosts by name before handing them back so the ordering is stable across HTTP Route Configs.
func SplitLocality ¶
Types ¶
This section is empty.