proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(cfg *config.Config, logger *slog.Logger, strategy balancer.Strategy, backends []*backend.Backend, metricsCollector *metrics.Metrics) *Handler

func (*Handler) BeginShutdown added in v0.2.1

func (h *Handler) BeginShutdown()

func (*Handler) BuilderURL

func (h *Handler) BuilderURL(u *url.URL) string

func (*Handler) Config

func (h *Handler) Config() *config.Config

func (*Handler) CurrentBackends

func (h *Handler) CurrentBackends() []*backend.Backend

func (*Handler) JSONStatus

func (h *Handler) JSONStatus(w http.ResponseWriter, _ *http.Request)

func (*Handler) MetricsEndpoint

func (h *Handler) MetricsEndpoint(w http.ResponseWriter, _ *http.Request)

func (*Handler) MetricsText

func (h *Handler) MetricsText() string

func (*Handler) ReplaceBackendSet added in v0.2.0

func (h *Handler) ReplaceBackendSet(backends []*backend.Backend, strategy balancer.Strategy, weights map[*backend.Backend]int)

func (*Handler) RoundTrip

func (h *Handler) RoundTrip(req *http.Request) (*http.Response, error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) SetBackends

func (h *Handler) SetBackends(backends []*backend.Backend)

func (*Handler) SetMetrics

func (h *Handler) SetMetrics(m *metrics.Metrics)

func (*Handler) SetStrategy

func (h *Handler) SetStrategy(s balancer.Strategy)

func (*Handler) Shutdown added in v0.2.1

func (h *Handler) Shutdown(ctx context.Context) int

func (*Handler) Status

func (h *Handler) Status() []map[string]any

func (*Handler) StatusEndpoint

func (h *Handler) StatusEndpoint(w http.ResponseWriter, r *http.Request)

func (*Handler) StopBackground

func (h *Handler) StopBackground()

func (*Handler) StrategyName

func (h *Handler) StrategyName() string

func (*Handler) Transport

func (h *Handler) Transport() *http.Transport

Jump to

Keyboard shortcuts

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