Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type LoadBalancer ¶
func NewLoadBalancer ¶
func NewLoadBalancer() *LoadBalancer
func (*LoadBalancer) AddBackend ¶
func (lb *LoadBalancer) AddBackend(backend *Backend)
func (*LoadBalancer) GetNextPeer ¶ added in v3.0.918
func (lb *LoadBalancer) GetNextPeer() (backend *Backend)
GetNextPeer
@return 可能为nil(即此时无可用后端服务)
func (*LoadBalancer) HealthCheck ¶ added in v3.0.918
func (lb *LoadBalancer) HealthCheck()
HealthCheck 健康检查.
func (*LoadBalancer) NextIndex ¶ added in v3.0.918
func (lb *LoadBalancer) NextIndex() int32
NextIndex 返回下一个下标.
PS: (1) 此方法无需加锁; (2) 需要自行对返回值先进行 其余操作(%) 才能继续使用.
func (*LoadBalancer) UpdateIndex ¶ added in v3.0.918
func (lb *LoadBalancer) UpdateIndex(i int32)
UpdateIndex 更新下标.
PS: 此方法无需加锁.
Click to show internal directories.
Click to hide internal directories.