middleware

package
v0.0.0-...-90656f1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LoggerCtxKey = &contextKey{"Logger"}
)

Functions

func GetLogger

func GetLogger(ctx context.Context) *logger.Logger

func Recoverer

func Recoverer() func(next http.Handler) http.Handler

Recoverer is a middleware that recovers from panics, logs the panic (and a backtrace), and returns a HTTP 500 (Internal Server Error) status if possible. Recoverer prints a request ID if one is provided.

Alternatively, look at https://github.com/pressly/lg middleware pkgs.

func RequestLogger

func RequestLogger(zl *logger.Logger) func(next http.Handler) http.Handler

RequestLogger returns a logger handler using a custom LogFormatter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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