balancer

package
v0.0.0-...-65f3eb6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNewNotEnoughProxiesError

func IsNewNotEnoughProxiesError(e error) bool

func NewNotEnoughProxiesError

func NewNotEnoughProxiesError(p protocol.Protocol) error

func RegisterBalancerFactory

func RegisterBalancerFactory(name string, factory BalancerFactory) error

Types

type Balancer

type Balancer interface {
	Name() string
	Next(protocol protocol.Protocol) (Proxy, error)
}

func New

func New(name string, getter Getter) (Balancer, error)

type BalancerFactory

type BalancerFactory func(getter Getter) (Balancer, error)

type Getter

type Getter interface {
	GetProxies(protocol protocol.Protocol) []Proxy
}

type Proxy

type Proxy = peer.ID
const (
	NoProxy Proxy = ""

	RoundRobin = "round_robin"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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