handler

package
v0.0.0-...-9bf20be Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBufferPool

func NewBufferPool() httputil.BufferPool

Types

type Handler

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

Handler is the reverse proxy handler

func NewHandler

func NewHandler(hc *Params) *Handler

NewHandler returns a new Handler

func (*Handler) GetQueueStatus

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

func (*Handler) NewHeaderPruningReverseProxy

func (h *Handler) NewHeaderPruningReverseProxy(target *url.URL) *httputil.ReverseProxy

NewHeaderPruningReverseProxy returns a httputil.ReverseProxy that proxies requests to the given targetHost after creating new headers.

func (*Handler) ProxyRequest

func (h *Handler) ProxyRequest(w http.ResponseWriter, req *http.Request, host *messages.Host, count int) (rErr error)

func (*Handler) ServeHTTP

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

type HostManager

type HostManager interface {
	GetHost(req *http.Request) (*messages.Host, error)
	DisableTrafficForHost(service string)
}

HostManager is to manage the hosts, and their traffic

type Operator

type Operator interface {
	SendIncomingRequestInfo(ns, svc string)
}

Operator is to communicate with the operator

type Params

type Params struct {
	Logger      *zap.Logger
	ReqTimeout  time.Duration
	OperatorRPC Operator
	HostManager HostManager
	Throttler   *throttler.Throttler
	Transport   http.RoundTripper
}

Params is the configuration for the handler

type QueueStatusResponse

type QueueStatusResponse struct {
	QueueStatus int `json:"queueStatus"`
}

type Response

type Response struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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