Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeastConnPolicy ¶ added in v0.0.26
type LeastConnPolicy struct {
// contains filtered or unexported fields
}
func NewLeastConnLoadBalancer ¶ added in v0.0.26
func NewLeastConnLoadBalancer(targets []string, weights []int) *LeastConnPolicy
func (*LeastConnPolicy) ChooseTarget ¶ added in v0.0.26
func (p *LeastConnPolicy) ChooseTarget(_ []string) string
func (*LeastConnPolicy) Done ¶ added in v0.0.26
func (p *LeastConnPolicy) Done(target string)
type LoadBalancer ¶
type RandomPolicy ¶ added in v0.0.26
type RandomPolicy struct{}
func NewRandomLoadBalancer ¶ added in v0.0.26
func NewRandomLoadBalancer() *RandomPolicy
func (*RandomPolicy) ChooseTarget ¶ added in v0.0.26
func (p *RandomPolicy) ChooseTarget(targets []string) string
func (*RandomPolicy) Done ¶ added in v0.0.26
func (p *RandomPolicy) Done(_ string)
type RoundRobinPolicy ¶
type RoundRobinPolicy struct {
// contains filtered or unexported fields
}
func NewRoundRobinLoadBalancer ¶ added in v0.0.26
func NewRoundRobinLoadBalancer() *RoundRobinPolicy
func (*RoundRobinPolicy) ChooseTarget ¶
func (p *RoundRobinPolicy) ChooseTarget(targets []string) string
func (*RoundRobinPolicy) Done ¶ added in v0.0.26
func (p *RoundRobinPolicy) Done(_ string)
type WeightedRoundRobinPolicy ¶ added in v0.0.26
type WeightedRoundRobinPolicy struct {
// contains filtered or unexported fields
}
func NewWRoundRobinLoadBalancer ¶ added in v0.0.26
func NewWRoundRobinLoadBalancer(weights []int) *WeightedRoundRobinPolicy
func (*WeightedRoundRobinPolicy) ChooseTarget ¶ added in v0.0.26
func (p *WeightedRoundRobinPolicy) ChooseTarget(targets []string) string
func (*WeightedRoundRobinPolicy) Done ¶ added in v0.0.26
func (p *WeightedRoundRobinPolicy) Done(_ string)
Click to show internal directories.
Click to hide internal directories.