Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHashBalance ¶
type ConsistentHashBalance struct {
// contains filtered or unexported fields
}
func NewConsistentHashBalance ¶
func NewConsistentHashBalance(replicas int, fn Hash) *ConsistentHashBalance
func (*ConsistentHashBalance) Add ¶
func (c *ConsistentHashBalance) Add(params ...string) error
func (*ConsistentHashBalance) IsEmpty ¶
func (c *ConsistentHashBalance) IsEmpty() bool
func (*ConsistentHashBalance) Update ¶
func (c *ConsistentHashBalance) Update(addrs []string)
type IPHashBalance ¶
type IPHashBalance struct {
// contains filtered or unexported fields
}
func (*IPHashBalance) Add ¶
func (ih *IPHashBalance) Add(params ...string) error
func (*IPHashBalance) Update ¶
func (ih *IPHashBalance) Update(addrs []string)
type LoadBalance ¶
func NewLoadBalanceFromFactorWithDiscovery ¶
func NewLoadBalanceFromFactorWithDiscovery(lbType LbType, discovery *etcd.ServiceDiscovery) LoadBalance
func NewLoadBalanceFromFactory ¶
func NewLoadBalanceFromFactory(lbType LbType) LoadBalance
type RandomBalance ¶
type RandomBalance struct {
// contains filtered or unexported fields
}
func (*RandomBalance) Add ¶
func (r *RandomBalance) Add(params ...string) error
func (*RandomBalance) Next ¶
func (r *RandomBalance) Next() string
func (*RandomBalance) Update ¶
func (r *RandomBalance) Update(addrs []string)
type RoundRobinBalance ¶
type RoundRobinBalance struct {
// contains filtered or unexported fields
}
func (*RoundRobinBalance) Add ¶
func (r *RoundRobinBalance) Add(params ...string) error
func (*RoundRobinBalance) Next ¶
func (r *RoundRobinBalance) Next() string
func (*RoundRobinBalance) Update ¶
func (r *RoundRobinBalance) Update(addrs []string)
type UInt32Slice ¶
type UInt32Slice []uint32
func (UInt32Slice) Len ¶
func (s UInt32Slice) Len() int
func (UInt32Slice) Less ¶
func (s UInt32Slice) Less(i, j int) bool
func (UInt32Slice) Swap ¶
func (s UInt32Slice) Swap(i, j int)
type WeightNode ¶
type WeightNode struct {
// contains filtered or unexported fields
}
type WeightRoundRobinBalance ¶
type WeightRoundRobinBalance struct {
// contains filtered or unexported fields
}
func (*WeightRoundRobinBalance) Add ¶
func (r *WeightRoundRobinBalance) Add(params ...string) error
Add 地址 权重值
func (*WeightRoundRobinBalance) Get ¶
func (r *WeightRoundRobinBalance) Get(key string) (string, error)
func (*WeightRoundRobinBalance) Next ¶
func (r *WeightRoundRobinBalance) Next() string
func (*WeightRoundRobinBalance) Update ¶
func (r *WeightRoundRobinBalance) Update(addrs []string)
Click to show internal directories.
Click to hide internal directories.