mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-24 18:11:19 +01:00
fixed output formatting
This commit is contained in:
@@ -20,3 +20,10 @@ func (p *httpLoadBalancePool) Add(route *HTTPRoute) {
|
||||
func (p *httpLoadBalancePool) Iterator() []*HTTPRoute {
|
||||
return p.pool
|
||||
}
|
||||
|
||||
func (p *httpLoadBalancePool) Pick() *HTTPRoute {
|
||||
// round-robin
|
||||
index := int(p.curentIndex.Load())
|
||||
defer p.curentIndex.Add(1)
|
||||
return p.pool[index%len(p.pool)]
|
||||
}
|
||||
Reference in New Issue
Block a user