Documentation
¶
Index ¶
- func NewBufferPool() httputil.BufferPool
- type Handler
- func (h *Handler) GetQueueStatus(w http.ResponseWriter, r *http.Request)
- func (h *Handler) NewHeaderPruningReverseProxy(target *url.URL) *httputil.ReverseProxy
- func (h *Handler) ProxyRequest(w http.ResponseWriter, req *http.Request, host *messages.Host, count int) (rErr error)
- func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)
- type HostManager
- type Operator
- type Params
- type QueueStatusResponse
- type Response
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 (*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 ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.