serverpool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: GPL-3.0 Imports: 9 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.TSDBServer
	Target(id string, d time.Duration) backend.TSDBServer
	Add(id string, b backend.TSDBServer)
	Size(id string) int
}

Manager is the interface every strategy must implement.

func New added in v0.2.0

func New(strategy string, logger log.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