lb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Add(Weighting)
	Next(ctx context.Context) Weighting
}

func New

type LoadBalanceAlgorithm

type LoadBalanceAlgorithm int32
const (
	Random LoadBalanceAlgorithm = iota
	RoundRobin
	RandomWeight
)

func (*LoadBalanceAlgorithm) UnmarshalText

func (l *LoadBalanceAlgorithm) UnmarshalText(text []byte) error

type RandomAlgorithm

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

func (*RandomAlgorithm) Add

func (r *RandomAlgorithm) Add(item Weighting)

func (*RandomAlgorithm) Next

type RandomWeightAlgorithm

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

func (*RandomWeightAlgorithm) Add

func (r *RandomWeightAlgorithm) Add(item Weighting)

func (*RandomWeightAlgorithm) Next

type RoundRobinAlgorithm

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

func (*RoundRobinAlgorithm) Add

func (r *RoundRobinAlgorithm) Add(item Weighting)

func (*RoundRobinAlgorithm) Next

type Weighting

type Weighting interface {
	Counting() bool
	Weight(ctx context.Context) int
}

Jump to

Keyboard shortcuts

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