middleware

package
v3.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMetrics

func HTTPMetrics(next http.Handler, record MetricsRecorder) http.Handler

HTTPMetrics will call the next handler and pass statistics to a MetricsRecorder to store the required metrics

func HandleForMethods

func HandleForMethods(next http.Handler, methods ...string) http.Handler

HandleForMethods wil only call the next handler if the request is for the specified method(s)

Types

type MetricsRecorder

type MetricsRecorder func(path, method string, statusCode int, duration time.Duration)

Jump to

Keyboard shortcuts

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