cluster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

Filter returns elements from the given clusters which match the given filters

func GetLoadBalancingPolicy

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

func (s *Stats) WeightedClusterSelectionCount() uint32

WeightedClusterSelectionCount returns the number of times the upstream cluster was selected in case of weighted routing to clusters (traffic shifting scenario)

Jump to

Keyboard shortcuts

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