Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractSubsetMetadata(subsetKeys []string, metadata v2.Metadata) types.SubsetMetadata
- func GenerateSubsetKeys(keysArray [][]string) []types.SortedStringSetType
- func GetOrCreateAddr(addrstr string) net.Addr
- func HostMatches(kvs types.SubsetMetadata, host types.Host) bool
- func NewCluster(clusterConfig v2.Cluster) types.Cluster
- func NewClusterManagerSingleton(clusters []v2.Cluster, clusterMap map[string][]v2.Host) types.ClusterManager
- func NewLBSubsetInfo(subsetCfg *v2.LBSubsetConfig) types.LBSubsetInfo
- func NewLoadBalancer(lbType types.LoadBalancerType, hosts types.HostSet) types.LoadBalancer
- func NewResourceManager(circuitBreakers v2.CircuitBreakers) types.ResourceManager
- func NewSimpleHost(config v2.Host, clusterInfo types.ClusterInfo) types.Host
- func NewSubsetLoadBalancer(info *clusterInfo, hostSet *hostSet) types.LoadBalancer
- func RegisterLBType(lbType types.LoadBalancerType, f func(types.HostSet) types.LoadBalancer)
- type LBSubsetEntryImpl
- func (entry *LBSubsetEntryImpl) Active() bool
- func (entry *LBSubsetEntryImpl) Children() types.LbSubsetMap
- func (entry *LBSubsetEntryImpl) CreateLoadBalancer(lbType types.LoadBalancerType, hosts types.HostSet)
- func (entry *LBSubsetEntryImpl) HostNum() int
- func (entry *LBSubsetEntryImpl) Initialized() bool
- func (entry *LBSubsetEntryImpl) LoadBalancer() types.LoadBalancer
- type LBSubsetInfoImpl
- type MngAdapter
- func (ca *MngAdapter) TriggerClusterAddOrUpdate(cluster v2.Cluster) error
- func (ca *MngAdapter) TriggerClusterAndHostsAddOrUpdate(cluster v2.Cluster, hosts []v2.Host) error
- func (ca *MngAdapter) TriggerClusterDel(clusterNames ...string) error
- func (ca *MngAdapter) TriggerClusterHostUpdate(clusterName string, hosts []v2.Host) error
- func (ca *MngAdapter) TriggerHostAppend(clusterName string, hostAppend []v2.Host) error
- func (ca *MngAdapter) TriggerHostDel(clusterName string, hosts []string) error
Constants ¶
View Source
const ( DefaultMaxConnections uint64 = 0 DefaultMaxPendingRequests uint64 = 0 DefaultMaxRequests uint64 = 0 DefaultMaxRetries uint64 = 0 )
default value is zero
Variables ¶
View Source
var AddrStore *sync.Map = &sync.Map{}
net.Addr reuse for same address, valid in simple type
Functions ¶
func ExtractSubsetMetadata ¶
func ExtractSubsetMetadata(subsetKeys []string, metadata v2.Metadata) types.SubsetMetadata
if subsetKeys are all contained in the host metadata
func GenerateSubsetKeys ¶
func GenerateSubsetKeys(keysArray [][]string) []types.SortedStringSetType
func GetOrCreateAddr ¶
func HostMatches ¶
func HostMatches(kvs types.SubsetMetadata, host types.Host) bool
func NewLBSubsetInfo ¶
func NewLBSubsetInfo(subsetCfg *v2.LBSubsetConfig) types.LBSubsetInfo
func NewLoadBalancer ¶
func NewLoadBalancer(lbType types.LoadBalancerType, hosts types.HostSet) types.LoadBalancer
func NewResourceManager ¶
func NewResourceManager(circuitBreakers v2.CircuitBreakers) types.ResourceManager
func NewSimpleHost ¶
func NewSubsetLoadBalancer ¶
func NewSubsetLoadBalancer(info *clusterInfo, hostSet *hostSet) types.LoadBalancer
func RegisterLBType ¶
func RegisterLBType(lbType types.LoadBalancerType, f func(types.HostSet) types.LoadBalancer)
Types ¶
type LBSubsetEntryImpl ¶
type LBSubsetEntryImpl struct {
// contains filtered or unexported fields
}
func (*LBSubsetEntryImpl) Active ¶
func (entry *LBSubsetEntryImpl) Active() bool
func (*LBSubsetEntryImpl) Children ¶
func (entry *LBSubsetEntryImpl) Children() types.LbSubsetMap
func (*LBSubsetEntryImpl) CreateLoadBalancer ¶
func (entry *LBSubsetEntryImpl) CreateLoadBalancer(lbType types.LoadBalancerType, hosts types.HostSet)
func (*LBSubsetEntryImpl) HostNum ¶
func (entry *LBSubsetEntryImpl) HostNum() int
func (*LBSubsetEntryImpl) Initialized ¶
func (entry *LBSubsetEntryImpl) Initialized() bool
func (*LBSubsetEntryImpl) LoadBalancer ¶
func (entry *LBSubsetEntryImpl) LoadBalancer() types.LoadBalancer
type LBSubsetInfoImpl ¶
type LBSubsetInfoImpl struct {
// contains filtered or unexported fields
}
func (*LBSubsetInfoImpl) DefaultSubset ¶
func (info *LBSubsetInfoImpl) DefaultSubset() types.SubsetMetadata
func (*LBSubsetInfoImpl) FallbackPolicy ¶
func (info *LBSubsetInfoImpl) FallbackPolicy() types.FallBackPolicy
func (*LBSubsetInfoImpl) IsEnabled ¶
func (info *LBSubsetInfoImpl) IsEnabled() bool
func (*LBSubsetInfoImpl) SubsetKeys ¶
func (info *LBSubsetInfoImpl) SubsetKeys() []types.SortedStringSetType
type MngAdapter ¶
type MngAdapter struct {
types.ClusterManager
}
cluster adapter wrapper cluster manager the adapter can call clustermanager directly but at most time, we call the wrapper functions
func GetClusterMngAdapterInstance ¶
func GetClusterMngAdapterInstance() *MngAdapter
func (*MngAdapter) TriggerClusterAddOrUpdate ¶
func (ca *MngAdapter) TriggerClusterAddOrUpdate(cluster v2.Cluster) error
func (*MngAdapter) TriggerClusterAndHostsAddOrUpdate ¶
func (*MngAdapter) TriggerClusterDel ¶
func (ca *MngAdapter) TriggerClusterDel(clusterNames ...string) error
func (*MngAdapter) TriggerClusterHostUpdate ¶
func (ca *MngAdapter) TriggerClusterHostUpdate(clusterName string, hosts []v2.Host) error
func (*MngAdapter) TriggerHostAppend ¶
func (ca *MngAdapter) TriggerHostAppend(clusterName string, hostAppend []v2.Host) error
func (*MngAdapter) TriggerHostDel ¶
func (ca *MngAdapter) TriggerHostDel(clusterName string, hosts []string) error
Click to show internal directories.
Click to hide internal directories.