You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package balancer
|
|
|
|
type Balancer interface {
|
|
NextPeer(nodes interface{}) (error, interface{})
|
|
}
|
|
|
|
// NewBalancer 根据策略标识返回新的负载均衡器
|
|
func NewBalancer(strategy string) Balancer {
|
|
switch strategy {
|
|
case "RoundRobin":
|
|
return &RoundRobin{}
|
|
default:
|
|
return &RoundRobin{}
|
|
}
|
|
}
|