algorithms

package
v0.0.0-...-d8c09a4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCleanupInterval = 15 * time.Minute
View Source
const DefaultExpiration = 30 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type IPHash

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

func NewIPHash

func NewIPHash(hash http_lb.HashingAlgorithm, serverPool http_lb.ServerPool, logger *zap.Logger) *IPHash

func (*IPHash) SelectServer

func (i *IPHash) SelectServer(r http_lb.Request) (string, error)

type Random

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

func NewRandom

func NewRandom(serverPool http_lb.ServerPool, logger *zap.Logger) *Random

func (*Random) SelectServer

func (r *Random) SelectServer(_ http_lb.Request) (string, error)

type RoundRobin

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

func NewRoundRobin

func NewRoundRobin(serverPool http_lb.ServerPool, logger *zap.Logger) *RoundRobin

func (*RoundRobin) SelectServer

func (r *RoundRobin) SelectServer(_ http_lb.Request) (string, error)

type StickyRoundRobin

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

func NewStickyRoundRobin

func NewStickyRoundRobin(serverPool http_lb.ServerPool, logger *zap.Logger) *StickyRoundRobin

func (*StickyRoundRobin) SelectServer

func (s *StickyRoundRobin) SelectServer(r http_lb.Request) (string, error)

type URLHash

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

func NewURLHash

func NewURLHash(hash http_lb.HashingAlgorithm, serverPool http_lb.ServerPool, logger *zap.Logger) *URLHash

func (*URLHash) SelectServer

func (u *URLHash) SelectServer(r http_lb.Request) (string, error)

Jump to

Keyboard shortcuts

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