Documentation ¶
Index ¶
- func Filter(clusters []*envoy_config_cluster_v3.Cluster, opts ...FilterOption) []*envoy_config_cluster_v3.Cluster
- func GetLoadBalancingPolicy(cluster *envoy_config_cluster_v3.Cluster) envoy_config_cluster_v3.Cluster_LbPolicy
- func GetMetadata(cluster *envoy_config_cluster_v3.Cluster) (map[string]interface{}, error)
- func GetTlsServerName(cluster *envoy_config_cluster_v3.Cluster) string
- func IsPermissive(cluster *envoy_config_cluster_v3.Cluster) bool
- func SelectCluster(weightedClusters map[string]uint32, clustersStats *ClustersStats) string
- func UsesTls(cluster *envoy_config_cluster_v3.Cluster) bool
- type ClustersStats
- type FilterOption
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter(clusters []*envoy_config_cluster_v3.Cluster, opts ...FilterOption) []*envoy_config_cluster_v3.Cluster
Filter returns elements from the given clusters which match the given filters
func GetLoadBalancingPolicy ¶
func GetLoadBalancingPolicy(cluster *envoy_config_cluster_v3.Cluster) envoy_config_cluster_v3.Cluster_LbPolicy
GetLoadBalancingPolicy returns the load balancing policy of the given cluster
func GetMetadata ¶
func GetMetadata(cluster *envoy_config_cluster_v3.Cluster) (map[string]interface{}, error)
func GetTlsServerName ¶
func GetTlsServerName(cluster *envoy_config_cluster_v3.Cluster) string
GetTlsServerName returns the SNI to be used when connecting to endpoints in the selectedCluster using TLS
func IsPermissive ¶
func IsPermissive(cluster *envoy_config_cluster_v3.Cluster) bool
IsPermissive returns true if the endpoints in the given cluster can accept both plaintext and mutual TLS traffic
func SelectCluster ¶
func SelectCluster(weightedClusters map[string]uint32, clustersStats *ClustersStats) string
SelectCluster selects a cluster from a list of clusters specified in weightedClusters when traffic is routed to multiple clusters according to their weight
func UsesTls ¶
func UsesTls(cluster *envoy_config_cluster_v3.Cluster) bool
UsesTls returns true if the endpoints in the given cluster accepts TLS traffic
Types ¶
type ClustersStats ¶
type ClustersStats struct { *util.KeyValueCollection[string, *Stats] }
ClustersStats stores Stats for a collection of clusters
func NewClustersStats ¶
func NewClustersStats() *ClustersStats
func (*ClustersStats) IncWeightedClusterSelectionCount ¶
func (cs *ClustersStats) IncWeightedClusterSelectionCount(clusterName string)
func (*ClustersStats) ResetWeightedClusterSelectionCount ¶
func (cs *ClustersStats) ResetWeightedClusterSelectionCount(clusterName string)
func (*ClustersStats) WeightedClusterSelectionCount ¶
func (cs *ClustersStats) WeightedClusterSelectionCount(clusterName string) uint32
WeightedClusterSelectionCount returns the number of times the upstream the given upstream cluster was selected in case of weighted routing to clusters (traffic shifting scenario)
type FilterOption ¶
type FilterOption interface {
Filter(*envoy_config_cluster_v3.Cluster) bool
}
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats stores various items related to an upstream cluster
func (*Stats) WeightedClusterSelectionCount ¶
WeightedClusterSelectionCount returns the number of times the upstream cluster was selected in case of weighted routing to clusters (traffic shifting scenario)