middleware

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertPrefix

func InsertPrefix(h http.Handler, prefix string) http.Handler

A modified version of http.StripPrefix

func LogRequest

func LogRequest(msg string, log logging.Logger, next http.HandlerFunc) http.HandlerFunc

LogRequest logs request info to the specified logger.

func NewStatusCapturingResponseWriter

func NewStatusCapturingResponseWriter(w http.ResponseWriter) *statusCapturingResponseWriter

func PanicRecovery

func PanicRecovery(log logging.Logger, next http.HandlerFunc) http.HandlerFunc

func RootRedirect

func RootRedirect(rootPath, targetPath string, next http.HandlerFunc) http.HandlerFunc

RootRedirect redirects root requests to a specified path

func ServeIndexOn404

func ServeIndexOn404(h http.Handler, location string) http.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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