lb

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 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 LBFactory

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

func NewLBFactory

func NewLBFactory(geoLoc *geolocs.GeoLoc) *LBFactory

func (*LBFactory) MakeLb

func (f *LBFactory) MakeLb(entry *entries.Entry, algo entries.LBAlgo) Loadbalancer

type Loadbalancer

type Loadbalancer interface {
	Next(ctx context.Context, memberType MemberType) (*entries.Member, error)
	Reset() error

	Name() string
}

type MemberType

type MemberType int
const (
	All MemberType = iota
	Ipv4
	Ipv6
)

type Random

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

func NewRandom

func NewRandom(entry *entries.Entry) *Random

func (*Random) Name added in v0.18.2

func (rtd *Random) Name() string

func (*Random) Next

func (rtd *Random) Next(_ context.Context, memberType MemberType) (*entries.Member, error)

func (*Random) Reset

func (rtd *Random) Reset() error

type RoundRobin

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

func NewRoundRobin

func NewRoundRobin(entry *entries.Entry) *RoundRobin

func (*RoundRobin) Name added in v0.18.2

func (rr *RoundRobin) Name() string

func (*RoundRobin) Next

func (rr *RoundRobin) Next(_ context.Context, memberType MemberType) (*entries.Member, error)

func (*RoundRobin) Reset

func (rr *RoundRobin) Reset() error

type Topology

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

func NewTopology

func NewTopology(entry *entries.Entry, geoLoc *geolocs.GeoLoc) *Topology

func (*Topology) Name added in v0.18.2

func (t *Topology) Name() string

func (*Topology) Next

func (t *Topology) Next(ctx context.Context, memberType MemberType) (*entries.Member, error)

func (*Topology) Reset

func (t *Topology) Reset() error

type WeightedRoundRobin

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

func NewWeightedRoundRobin

func NewWeightedRoundRobin(entry *entries.Entry) *WeightedRoundRobin

func (*WeightedRoundRobin) Name added in v0.18.2

func (wrr *WeightedRoundRobin) Name() string

func (*WeightedRoundRobin) Next

func (wrr *WeightedRoundRobin) Next(_ context.Context, memberType MemberType) (*entries.Member, error)

func (*WeightedRoundRobin) Reset

func (wrr *WeightedRoundRobin) Reset() error

Jump to

Keyboard shortcuts

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