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: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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