middleware

package
v0.0.0-...-0820d52 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpVarHandler

func ExpVarHandler(path string, h http.Handler) http.Handler

ExpVarHandler returns the expvar HTTP Handler

func HTTPStatsHandler

func HTTPStatsHandler(h http.Handler) http.Handler

HTTPStatsHandler is a handler that handles stats of HTTP requests

func HealthHandler

func HealthHandler(h http.Handler) http.Handler

HealthHandler is simple handler for /health endpoint that returns 200 OK status

func MetricsHandler

func MetricsHandler(h http.Handler, r *metrics.Registry) http.Handler

MetricsHandler is a handler that creates counters for client and server http errors

func NoCache

func NoCache(h http.Handler) http.Handler

NoCache is a simple piece of middleware that sets a number of HTTP headers to prevent a router (or subrouter) from being cached by an upstream proxy and/or client.

As per http://wiki.nginx.org/HttpProxyModule - NoCache sets:

Expires: Thu, 01 Jan 1970 00:00:00 UTC
Cache-Control: no-cache, private, max-age=0
X-Accel-Expires: 0
Pragma: no-cache (for HTTP/1.0 proxies/clients)

func PrometheusHandler

func PrometheusHandler(path string, h http.Handler) http.Handler

PrometheusHandler adds default prometheus handler middleware

func RecoverHandler

func RecoverHandler(h http.Handler) http.Handler

RecoverHandler handles panic (writes panic message to log)

Types

This section is empty.

Jump to

Keyboard shortcuts

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