loadbalance

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdaptive added in v1.1.0

func NewAdaptive(dials []proxyclient.Dial) proxyclient.Dial

NewAdaptive creates a Dial that tracks success/failure/latency per node and routes traffic to the best-performing nodes.

func NewHash

func NewHash(proxies []proxyclient.Dial) proxyclient.Dial

func NewRandom

func NewRandom(proxies []proxyclient.Dial) proxyclient.Dial

func NewRoundRobin

func NewRoundRobin(proxies []proxyclient.Dial) proxyclient.Dial

Types

type Tracker added in v1.1.0

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

Tracker wraps a set of Dials with dead-node detection. Nodes that fail consecutively are temporarily removed from rotation.

func NewTracker added in v1.1.0

func NewTracker(dials []proxyclient.Dial) *Tracker

func (*Tracker) AliveIndices added in v1.1.0

func (t *Tracker) AliveIndices() []int

AliveIndices returns indices of nodes currently considered alive.

func (*Tracker) Dial added in v1.1.0

func (t *Tracker) Dial(ctx context.Context, network, address string, pick int) (net.Conn, error)

Dial tries the node at index, records success/failure, and falls back on error.

func (*Tracker) Len added in v1.1.0

func (t *Tracker) Len() int

Jump to

Keyboard shortcuts

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