random

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.9.0

func Init() error

Init registers the random balancer.

Types

type Balancer added in v0.10.0

type Balancer struct {
	// contains filtered or unexported fields
}

Balancer implements a random load balancing strategy.

func NewBalancer

func NewBalancer(proxies []proxy.Proxy) *Balancer

NewBalancer creates a new random Balancer instance.

func (*Balancer) Proxies added in v0.10.0

func (b *Balancer) Proxies() []proxy.Proxy

Proxies returns the list of proxies managed by the balancer.

func (*Balancer) Select added in v0.10.0

func (b *Balancer) Select(_ context.Context, _ *app.RequestContext) (proxy.Proxy, error)

Select picks a random available proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL