Documentation ¶
Index ¶
- Constants
- Variables
- func BuildAddress(bind string, port uint32) core.Address
- func CloneCluster(cluster *xdsapi.Cluster) *xdsapi.Cluster
- func CloneLocalityLbEndpoints(endpoints []endpoint.LocalityLbEndpoints) []endpoint.LocalityLbEndpoints
- 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 IsProxyVersionGE11(node *model.Proxy) bool
- func LbPriority(proxyLocality, endpointsLocality model.LocalityInterface) int
- func LocalityLbWeightNormalize(endpoints []endpoint.LocalityLbEndpoints) []endpoint.LocalityLbEndpoints
- func LocalityMatch(proxyLocality model.LocalityInterface, ruleLocality string) bool
- 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" )
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 CloneCluster ¶
return a shallow copy cluster
func CloneLocalityLbEndpoints ¶
func CloneLocalityLbEndpoints(endpoints []endpoint.LocalityLbEndpoints) []endpoint.LocalityLbEndpoints
return a shallow copy LocalityLbEndpoints
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 IsProxyVersionGE11 ¶
IsProxyVersionGE11 checks whether the given Proxy version is greater than or equals 1.1.
func LbPriority ¶
func LbPriority(proxyLocality, endpointsLocality model.LocalityInterface) int
func LocalityLbWeightNormalize ¶
func LocalityLbWeightNormalize(endpoints []endpoint.LocalityLbEndpoints) []endpoint.LocalityLbEndpoints
LocalityLbWeightNormalize set LocalityLbEndpoints within a cluster with a valid LoadBalancingWeight.
func LocalityMatch ¶
func LocalityMatch(proxyLocality model.LocalityInterface, ruleLocality string) bool
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.