serverpool

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package serverpool implements the interface that manages pool of backend servers of load balancer app

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidStrategy = errors.New("invalid strategy")
)

Custom errors.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Backends() map[string][]backend.Server
	Target(id string) backend.Server
	Add(id string, b backend.Server)
	Size(id string) int
}

Manager is the interface every strategy must implement.

func New

func New(strategy base.LBStrategy, logger *slog.Logger) (Manager, error)

New returns a new instance of server pool manager.

Jump to

Keyboard shortcuts

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