# Functions
BuildKey return key of stats map.
BuildStrategy query instance list and give it to Strategy then return Strategy.
DeleteSuccessiveFailureCount deleting cookie from failure count map.
Enable function is for to enable load balance strategy.
GetStrategyPlugin get strategy plugin.
GetSuccessiveFailureCount get failure count.
IncreaseSuccessiveFailureCount increase failure count.
InstallFilter install filter.
InstallStrategy install strategy.
ResetSuccessiveFailureMap make map again.
SetLatency for a instance ,it only save latest 10 stats for instance's protocol.
# Constants
constant strings for load balance variables.
constant strings for load balance variables.
constant strings for load balance variables.
constant strings for load balance variables.
StrategyLatency is name.
constant strings for load balance variables.
constant strings for load balance variables.
constant strings for load balance variables.
constant string for zoneaware.
# Variables
ErrNoneAvailableInstance is to represent load balance error.
Filters is a map of string and array of *registry.MicroServiceInstance.
maintain different locks since multiple goroutine access the map.
ProtocolStatsMap saves all stats for all service's protocol, one protocol has a lot of instances.
# Structs
Criteria is rule for filter.
LBError load balance error.
ProtocolStats store protocol stats.
RandomStrategy is strategy.
RoundRobinStrategy is strategy.
SessionStickinessStrategy is strategy.
# Interfaces
Strategy is load balancer algorithm , call Pick to return one instance.
# Type aliases
Filter receive instances and criteria, it will filter instances based on criteria you defined,criteria is optional, you can give nil for it.