Documentation ¶
Overview ¶
Package lb
@author: xwc1125
Package lb ¶
@author: xwc1125
Index ¶
Constants ¶
View Source
const ( RoundRobin = "roundrobin" IPHash = "iphash" CHash = "chash" Rand = "Rand" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashCBalance ¶
type HashCBalance struct {
// contains filtered or unexported fields
}
func (HashCBalance) Distribute ¶
func (lb HashCBalance) Distribute(req *fasthttp.Request) int64
type HashIPBalance ¶
type HashIPBalance struct {
// contains filtered or unexported fields
}
HashIPBalance is hash IP loadBalance impl
func (HashIPBalance) Distribute ¶
func (lb HashIPBalance) Distribute(ctx *fasthttp.Request) int64
Distribute select a server from servers using HashIPBalance
type LoadBalance ¶
LoadBalance .
func NewBalancer ¶
func NewBalancer(upstreamDef *entity.UpstreamDef, ws []W) LoadBalance
NewBalancer ...
type RandBalance ¶
type RandBalance struct {
// contains filtered or unexported fields
}
RandBalance is rand loadBalance impl
func (RandBalance) Distribute ¶
func (rb RandBalance) Distribute(req *fasthttp.Request) int64
Click to show internal directories.
Click to hide internal directories.