middleware

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GzipMiddleware    = handlers.CompressHandler
	LoggingMiddleware = func(next http.Handler) http.Handler {
		return handlers.LoggingHandler(os.Stderr, next)
	}
	GoroutineMiddleware = func(next http.Handler) http.Handler {
		return http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			log.Println("You've got", runtime.NumGoroutine(), "goroutines running")
			next.ServeHTTP(w, r)
		}))
	}
	AllowAllCorsMiddleware = func(next http.Handler) http.Handler {
		return cors.AllowAll().Handler(next)
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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