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 MakeAsyncReport(metrics metrics.MetricOptions) http.HandlerFunc
- func MakeCallIDMiddleware(next http.HandlerFunc) http.HandlerFunc
- func MakeExternalAuthHandler(next http.HandlerFunc, upstreamTimeout time.Duration, upstreamURL string, ...) 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 queue.RequestQueuer, ...) http.HandlerFunc
- func MakeScalingHandler(next http.HandlerFunc, scaler scaling.FunctionScaler, ...) http.HandlerFunc
- func NewLogHandlerFunc(logProvider url.URL, timeout time.Duration) http.HandlerFunc
- type BaseURLResolver
- type CORSHandler
- type FunctionAsHostBaseURLResolver
- type FunctionPrefixTrimmingURLPathTransformer
- type HTTPNotifier
- type LoggingNotifier
- type PrometheusFunctionNotifier
- type PrometheusServiceNotifier
- type SingleHostBaseURLResolver
- type TransparentURLPathTransformer
- type URLPathTransformer
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 MakeAsyncReport ¶
func MakeAsyncReport(metrics metrics.MetricOptions) http.HandlerFunc
MakeAsyncReport makes a handler for asynchronous invocations to report back into.
func MakeCallIDMiddleware ¶
func MakeCallIDMiddleware(next http.HandlerFunc) http.HandlerFunc
MakeCallIDMiddleware middleware tags a request with a uid
func MakeExternalAuthHandler ¶
func MakeExternalAuthHandler(next http.HandlerFunc, upstreamTimeout time.Duration, upstreamURL string, passBody bool) http.HandlerFunc
MakeExternalAuthHandler make an authentication proxy handler
func MakeForwardingProxyHandler ¶
func MakeForwardingProxyHandler(proxy *types.HTTPClientReverseProxy, notifiers []HTTPNotifier, baseURLResolver BaseURLResolver, urlPathTransformer URLPathTransformer, serviceAuthInjector middleware.AuthInjector) http.HandlerFunc
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 queue.RequestQueuer, pathTransformer 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 BaseURLResolver ¶
BaseURLResolver URL resolver for upstream requests
type CORSHandler ¶
CORSHandler set custom CORS instructions for the store.
func (CORSHandler) ServeHTTP ¶
func (c CORSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FunctionAsHostBaseURLResolver ¶
FunctionAsHostBaseURLResolver resolves URLs using a function from the URL as a host
type FunctionPrefixTrimmingURLPathTransformer ¶
type FunctionPrefixTrimmingURLPathTransformer struct { }
FunctionPrefixTrimmingURLPathTransformer removes the "/function/servicename/" prefix from the URL path.
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
}
PrometheusFunctionNotifier records metrics to Prometheus
type PrometheusServiceNotifier ¶
type PrometheusServiceNotifier struct {
ServiceMetrics *metrics.ServiceMetricOptions
}
PrometheusServiceNotifier notifier for core service endpoints
type SingleHostBaseURLResolver ¶
type SingleHostBaseURLResolver struct {
BaseURL string
}
SingleHostBaseURLResolver resolves URLs against a single BaseURL
type TransparentURLPathTransformer ¶
type TransparentURLPathTransformer struct { }
TransparentURLPathTransformer passes the requested URL path through untouched.
type URLPathTransformer ¶
URLPathTransformer Transform the incoming URL path for upstream requests