Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RandomBalancer ¶
type RandomBalancer struct {
// contains filtered or unexported fields
}
RandomBalancer implements a random load balancing algorithm.
func NewBalancer ¶
func NewBalancer(proxies []proxy.Proxy) *RandomBalancer
NewBalancer creates a new RandomBalancer instance.
func (*RandomBalancer) Proxies ¶
func (b *RandomBalancer) Proxies() []proxy.Proxy
Proxies returns the list of proxies managed by the balancer.
func (*RandomBalancer) Select ¶
func (b *RandomBalancer) Select(ctx context.Context, hzCtx *app.RequestContext) (proxy.Proxy, error)
Select picks a random available proxy.
Click to show internal directories.
Click to hide internal directories.