Documentation ¶
Index ¶
- func CalculateReplicas(status string, currentReplicas uint64, maxReplicas uint64, minReplicas uint64, ...) uint64
- func DecorateWithCORS(upstream http.Handler, allowedHost string) http.Handler
- func HealthzHandler(w http.ResponseWriter, r *http.Request)
- func MakeAlertHandler(service scaling.ServiceQuery, defaultNamespace string) http.HandlerFunc
- func MakeCallIDMiddleware(next http.HandlerFunc) http.HandlerFunc
- func MakeForwardingProxyHandler(proxy *types.HTTPClientReverseProxy, notifiers []HTTPNotifier, ...) http.HandlerFunc
- func MakeInfoHandler(h http.Handler) http.HandlerFunc
- func MakeNotifierWrapper(next http.HandlerFunc, notifiers []HTTPNotifier) http.HandlerFunc
- func MakeQueuedProxy(metrics metrics.MetricOptions, queuer ftypes.RequestQueuer, ...) http.HandlerFunc
- func MakeScalingHandler(next http.HandlerFunc, scaler scaling.FunctionScaler, ...) http.HandlerFunc
- func NewLogHandlerFunc(logProvider url.URL, timeout time.Duration) http.HandlerFunc
- type CORSHandler
- type HTTPNotifier
- type LoggingNotifier
- type PrometheusFunctionNotifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateReplicas ¶
func CalculateReplicas(status string, currentReplicas uint64, maxReplicas uint64, minReplicas uint64, scalingFactor uint64) uint64
CalculateReplicas decides what replica count to set depending on current/desired amount
func DecorateWithCORS ¶
DecorateWithCORS decorate a handler with CORS-injecting middleware
func HealthzHandler ¶
func HealthzHandler(w http.ResponseWriter, r *http.Request)
HealthzHandler healthz hanlder for mertics server
func MakeAlertHandler ¶
func MakeAlertHandler(service scaling.ServiceQuery, defaultNamespace string) http.HandlerFunc
MakeAlertHandler handles alerts from Prometheus Alertmanager
func MakeCallIDMiddleware ¶
func MakeCallIDMiddleware(next http.HandlerFunc) http.HandlerFunc
MakeCallIDMiddleware middleware tags a request with a uid
func MakeForwardingProxyHandler ¶
func MakeForwardingProxyHandler(proxy *types.HTTPClientReverseProxy, notifiers []HTTPNotifier, baseURLResolver middleware.BaseURLResolver, urlPathTransformer middleware.URLPathTransformer, serviceAuthInjector middleware.AuthInjector) http.HandlerFunc
NOTE: MakeForwardingProxyHandler create a handler which forwards HTTP requests
func MakeInfoHandler ¶
func MakeInfoHandler(h http.Handler) http.HandlerFunc
MakeInfoHandler is responsible for display component version information
func MakeNotifierWrapper ¶
func MakeNotifierWrapper(next http.HandlerFunc, notifiers []HTTPNotifier) http.HandlerFunc
MakeNotifierWrapper wraps a http.HandlerFunc in an interceptor to pass to HTTPNotifier
func MakeQueuedProxy ¶
func MakeQueuedProxy(metrics metrics.MetricOptions, queuer ftypes.RequestQueuer, pathTransformer middleware.URLPathTransformer, defaultNS string, functionQuery scaling.FunctionQuery) http.HandlerFunc
MakeQueuedProxy accepts work onto a queue
func MakeScalingHandler ¶
func MakeScalingHandler(next http.HandlerFunc, scaler scaling.FunctionScaler, config scaling.ScalingConfig, defaultNamespace string) http.HandlerFunc
MakeScalingHandler creates handler which can scale a function from zero to N replica(s). After scaling the next http.HandlerFunc will be called. If the function is not ready after the configured amount of attempts / queries then next will not be invoked and a status will be returned to the client.
func NewLogHandlerFunc ¶
NewLogHandlerFunc creates and http HandlerFunc from the supplied log Requestor.
Types ¶
type CORSHandler ¶
CORSHandler set custom CORS instructions for the store.
func (CORSHandler) ServeHTTP ¶
func (c CORSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HTTPNotifier ¶
type HTTPNotifier interface {
Notify(method string, URL string, originalURL string, statusCode int, event string, duration time.Duration)
}
HTTPNotifier notify about HTTP request/response
type LoggingNotifier ¶
type LoggingNotifier struct { }
LoggingNotifier notifies a log about a request
type PrometheusFunctionNotifier ¶
type PrometheusFunctionNotifier struct { Metrics *metrics.MetricOptions //FunctionNamespace default namespace of the function FunctionNamespace string }
PrometheusFunctionNotifier records metrics to Prometheus