pool

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pool provides an application load balancer pool

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool interface {
	// Targets returns the current set of dispatchable targets, re-filtered
	// against each target's atomic hcStatus. This closes the race window
	// between a status flip and the asynchronous healthy-list refresh, so it
	// is the correct method for request dispatch.
	Targets() Targets
	// ConfiguredLen returns the number of pool members as configured, regardless
	// of current health. Mechanisms compare this against len(Targets()) to
	// detect a pool degraded to a subset of its configured members.
	ConfiguredLen() int
	// SetHealthy seeds the pool's healthy set from a handler list. Intended
	// for tests and bootstrap paths that don't drive status updates through
	// healthcheck subscribers.
	SetHealthy([]http.Handler)
	// Stop stops the pool and its health checker goroutines.
	Stop()
	// RefreshHealthy forces a refresh of the pool's healthy handlers list.
	RefreshHealthy()
}

Pool defines the interface for a load balancer pool

func New

func New(targets Targets, 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,
	backend backends.Backend,
) *Target

NewTarget returns a new Target using the provided inputs

func (*Target) Backend

func (t *Target) Backend() backends.Backend

func (*Target) Handler

func (t *Target) Handler() http.Handler

func (*Target) HealthStatus

func (t *Target) HealthStatus() *healthcheck.Status

type Targets

type Targets []*Target

Jump to

Keyboard shortcuts

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