middleware

package
v0.0.0-...-015e340 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogRequest

func LogRequest(log *logrus.Logger) func(next http.Handler) http.Handler

LogRequest returns a function that accepts an http.Handler and returns another http.Handler that logs all requests that come in. This format is needed so that we can pass an external logger and reuse this function in an alice middleware chain.

func RecoverPanic

func RecoverPanic(log *logrus.Logger) func(next http.Handler) http.Handler

RecoverPanic is a middleware that handles all panic that occur during the execution of the request logs them, sets a Connection: Close header and returns Internal error to the consumer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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