Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseBalancer ¶
type BaseBalancer struct {
// contains filtered or unexported fields
}
type IPHashBalancer ¶
type IPHashBalancer struct {
BaseBalancer
}
IPHashBalancer IP哈希负载均衡
func NewIPHashBalancer ¶
func NewIPHashBalancer(servers []Server) *IPHashBalancer
type LoadBalancer ¶
var Handler *LoadBalancer
Handler 各个业务的负载均衡器
func (*LoadBalancer) Get ¶
func (l *LoadBalancer) Get(service *dao.ServiceDetail) (Balancer, error)
func (*LoadBalancer) Update ¶
func (l *LoadBalancer) Update(serviceName string)
type RandomBalancer ¶
type RandomBalancer struct {
BaseBalancer
}
RandomBalancer 随机负载均衡
func NewRandomBalancer ¶
func NewRandomBalancer(servers []Server) *RandomBalancer
type RoundRobinBalancer ¶
type RoundRobinBalancer struct { BaseBalancer // contains filtered or unexported fields }
RoundRobinBalancer 轮询负载均衡
func NewRoundRobinBalancer ¶
func NewRoundRobinBalancer(servers []Server) *RoundRobinBalancer
type WeightedBalancer ¶
type WeightedBalancer struct {
BaseBalancer
}
WeightedBalancer 权重负载均衡
func NewWeightedBalancer ¶
func NewWeightedBalancer(servers []Server) *WeightedBalancer
Click to show internal directories.
Click to hide internal directories.