backend

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package backend implements the backend TSDB server of load balancer app

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTypeAssertion = errors.New("failed type assertion")
)

Custom errors.

Functions

This section is empty.

Types

type Server added in v0.5.1

type Server interface {
	SetAlive(alive bool)
	IsAlive() bool
	URL() *url.URL
	String() string
	ActiveConnections() int
	RetentionPeriod() time.Duration
	Serve(w http.ResponseWriter, r *http.Request)
}

Server is the interface each backend server (TSDB/Pyroscope) needs to implement.

func New added in v0.2.0

func New(t base.LBType, u *url.URL, rp *httputil.ReverseProxy, logger *slog.Logger) (Server, error)

New returns a backend server of type `t`.

func NewPyroscope added in v0.5.1

func NewPyroscope(webURL *url.URL, p *httputil.ReverseProxy, logger *slog.Logger) Server

NewPyroscope returns an instance of backend Pyroscope server.

func NewTSDB added in v0.5.1

func NewTSDB(webURL *url.URL, p *httputil.ReverseProxy, logger *slog.Logger) Server

NewTSDB returns an instance of backend TSDB server.

Jump to

Keyboard shortcuts

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