middleware

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 7 Imported by: 3

Documentation

Overview

Package middleware implements reusable HTTP middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recovery added in v2.3.0

func Recovery(log *logger.Logger) func(http.Handler) http.Handler

Recovery is a wrapper for WithRecovery.

func Stats added in v2.3.0

func Stats(name string, s *statter.Statter) func(http.Handler) http.Handler

Stats is a wrapper for WithStats.

func WithRecovery

func WithRecovery(h http.Handler, log *logger.Logger) http.Handler

WithRecovery recovers from panics and log the error.

func WithStats

func WithStats(name string, s *statter.Statter, h http.Handler) http.Handler

WithStats collects statistics about HTTP requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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