Documentation
¶
Index ¶
Constants ¶
View Source
const ( Random = "random" Poll = "poll" WeightPoll = "weight_poll" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PollBalancer ¶
type PollBalancer struct {
// contains filtered or unexported fields
}
PollBalancer 轮询负载均衡器.
func (*PollBalancer) Get ¶
func (pb *PollBalancer) Get(s *selector.ServiceNodes) *selector.Node
Get 选择合适的选择器来进行选择.
type RandomBalancer ¶
type RandomBalancer struct {
}
RandomBalancer 获取随机结点的负载均衡.
func (*RandomBalancer) Get ¶
func (b *RandomBalancer) Get(s *selector.ServiceNodes) *selector.Node
Get 通过时间戳随机生成一个随机数,
type WeightPollBalancer ¶
type WeightPollBalancer struct {
// contains filtered or unexported fields
}
func (*WeightPollBalancer) Get ¶
func (w *WeightPollBalancer) Get(s *selector.ServiceNodes) *selector.Node
Get 获取具体选择器再通过选择器pick到具体结点.
Click to show internal directories.
Click to hide internal directories.