balancer

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAvailable = errors.New("no available upstream at the moment")
)

Functions

func Register

func Register(names []string, h CreateBalancerHandler) error

Types

type Balancer

type Balancer interface {
	Proxies() []proxy.Proxy
	Select(ctx context.Context, hzCtx *app.RequestContext) (proxy.Proxy, error)
}

type CreateBalancerHandler

type CreateBalancerHandler func(proxies []proxy.Proxy, params any) (Balancer, error)

func Factory

func Factory(name string) CreateBalancerHandler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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