pool

package
v2.0.0-beta2.0...-3469a79 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package pool provides an application load balancer pool

Index

Constants

This section is empty.

Variables

View Source
var MechanismLookup = map[string]Mechanism{
	"rr":  RoundRobin,
	"fr":  FirstResponse,
	"fgr": FirstGoodResponse,
	"nlm": NewestLastModified,
	"tsm": TimeSeriesMerge,
}

MechanismLookup provides for looking up Mechanisms by name

View Source
var MechanismValues = map[Mechanism]string{}

MechanismValues provides for looking up Mechanism by names

Functions

This section is empty.

Types

type Mechanism

type Mechanism byte

Mechanism defines the load balancing mechanism identifier type

const (
	// RoundRobin defines the Basic Round Robin load balancing mechanism
	RoundRobin Mechanism = iota
	// FirstResponse defines the First Response load balancing mechanism
	FirstResponse
	// FirstGoodResponse defines the First Good Response load balancing mechanism
	FirstGoodResponse
	// NewestLastModified defines the Newest Last-Modified load balancing mechanism
	NewestLastModified
	// TimeSeriesMerge defines the Time Series Merge load balancing mechanism
	TimeSeriesMerge
)

func GetMechanismByName

func GetMechanismByName(name string) (Mechanism, bool)

GetMechanismByName returns the Mechanism value and True if the mechanism name is known

func (Mechanism) String

func (m Mechanism) String() string

type Pool

type Pool interface {
	Next() []http.Handler
}

Pool defines the interface for a load balancer pool

func New

func New(mechanism Mechanism, targets []*Target, healthyFloor int) Pool

New returns a new pool

type Target

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

Target defines an alb pool target

func NewTarget

func NewTarget(handler http.Handler, hcStatus *healthcheck.Status) *Target

NewTarget returns a new Target using the provided inputs

Jump to

Keyboard shortcuts

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