Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConcurrencyReporter ¶
NewConcurrencyReporter instantiates a new goroutine that consumes and produces from the given channels. On each tick on the ReportChan, StatMessages will be sent to the StatChan.
Types ¶
type ActivationHandler ¶
type ActivationHandler struct {
Activator activator.Activator
Logger *zap.SugaredLogger
Transport http.RoundTripper
Reporter activator.StatsReporter
}
ActivationHandler will wait for an active endpoint for a revision to be available before proxing the request
func (*ActivationHandler) ServeHTTP ¶
func (a *ActivationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Channels ¶
type Channels struct {
// Ticks with every request arrived/completed respectively
ReqChan chan ReqEvent
// Ticks with every stat report request
ReportChan <-chan time.Time
// Stat reporting channel
StatChan chan *autoscaler.StatMessage
}
Channels is a structure for holding the channels for driving Stats. It's just to make the NewStats signature easier to read.
type EnforceMaxContentLengthHandler ¶
EnforceMaxContentLengthHandler prevents uploads larger than `MaxContentLengthBytes`
func (*EnforceMaxContentLengthHandler) ServeHTTP ¶
func (h *EnforceMaxContentLengthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FilteringHandler ¶
FilteringHandler will filter requests sent by the activator itself.
func (*FilteringHandler) ServeHTTP ¶
func (h *FilteringHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ReqEvent ¶
type ReqEvent struct {
Key string
EventType ReqEventType
}
ReqEvent represents an incoming/finished request with a given key
type ReqEventType ¶
type ReqEventType int
ReqEventType specifies the type of event (In/Out)
const ( // ReqIn represents an incoming request ReqIn ReqEventType = iota // ReqOut represents a finished request ReqOut )
type RequestEventHandler ¶
type RequestEventHandler struct {
ReqChan chan ReqEvent
// contains filtered or unexported fields
}
RequestEventHandler sends events to the given channel.
func NewRequestEventHandler ¶
func NewRequestEventHandler(reqChan chan ReqEvent, next http.Handler) *RequestEventHandler
NewRequestEventHandler creates a handler that sends events about incoming/closed http connections to the given channel.
func (*RequestEventHandler) ServeHTTP ¶
func (h *RequestEventHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)