Versions in this module Expand all Collapse all v0 v0.1.0 Aug 26, 2020 Changes in this version + const DefaultCheckInterval + const DefaultCheckMaxErrNum + const DefaultCheckMethod + const DefaultCheckTimeout + type ConsistentHashBanlance struct + func NewConsistentHashBanlance(replicas int, fn Hash) *ConsistentHashBanlance + func (c *ConsistentHashBanlance) Add(params ...string) error + func (c *ConsistentHashBanlance) Get(key string) (string, error) + func (c *ConsistentHashBanlance) IsEmpty() bool + func (c *ConsistentHashBanlance) SetConf(conf LoadBalanceConf) + func (c *ConsistentHashBanlance) Update() + type Hash func(data []byte) uint32 + type LbType int + const LbConsistentHash + const LbRandom + const LbRoundRobin + const LbWeightRoundRobin + type LoadBalance interface + Add func(...string) error + Get func(string) (string, error) + Update func() + func LoadBanlanceFactorWithConf(lbType LbType, mConf LoadBalanceConf) LoadBalance + func LoadBanlanceFactory(lbType LbType) LoadBalance + type LoadBalanceCheckConf struct + func NewLoadBalanceCheckConf(format string, conf map[string]string) (*LoadBalanceCheckConf, error) + func (s *LoadBalanceCheckConf) Attach(o Observer) + func (s *LoadBalanceCheckConf) GetConf() []string + func (s *LoadBalanceCheckConf) NotifyAllObservers() + func (s *LoadBalanceCheckConf) UpdateConf(conf []string) + func (s *LoadBalanceCheckConf) WatchConf() + type LoadBalanceConf interface + Attach func(o Observer) + GetConf func() []string + UpdateConf func(conf []string) + WatchConf func() + type LoadBalanceObserver struct + ModuleConf *LoadBalanceZkConf + func NewLoadBalanceObserver(conf *LoadBalanceZkConf) *LoadBalanceObserver + func (l *LoadBalanceObserver) Update() + type LoadBalanceZkConf struct + func NewLoadBalanceZkConf(format, path string, zkHosts []string, conf map[string]string) (*LoadBalanceZkConf, error) + func (s *LoadBalanceZkConf) Attach(o Observer) + func (s *LoadBalanceZkConf) GetConf() []string + func (s *LoadBalanceZkConf) NotifyAllObservers() + func (s *LoadBalanceZkConf) UpdateConf(conf []string) + func (s *LoadBalanceZkConf) WatchConf() + type Observer interface + Update func() + type RandomBalance struct + func (r *RandomBalance) Add(params ...string) error + func (r *RandomBalance) Get(key string) (string, error) + func (r *RandomBalance) Next() string + func (r *RandomBalance) SetConf(conf LoadBalanceConf) + func (r *RandomBalance) Update() + type RoundRobinBalance struct + func (r *RoundRobinBalance) Add(params ...string) error + func (r *RoundRobinBalance) Get(key string) (string, error) + func (r *RoundRobinBalance) Next() string + func (r *RoundRobinBalance) SetConf(conf LoadBalanceConf) + func (r *RoundRobinBalance) Update() + type UInt32Slice []uint32 + func (s UInt32Slice) Len() int + func (s UInt32Slice) Less(i, j int) bool + func (s UInt32Slice) Swap(i, j int) + type WeightNode struct + type WeightRoundRobinBalance struct + func (r *WeightRoundRobinBalance) Add(params ...string) error + func (r *WeightRoundRobinBalance) Get(key string) (string, error) + func (r *WeightRoundRobinBalance) Next() string + func (r *WeightRoundRobinBalance) SetConf(conf LoadBalanceConf) + func (r *WeightRoundRobinBalance) Update()