middleware

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMetrics

func HTTPMetrics(next http.Handler) http.Handler

HTTPMetrics measures a handler's processing time and records them in a prometheus Summary metric

func HTTPMetricsWithRecorder added in v0.6.2

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

HTTPMetricsWithRecorder measures a handler's processing time and called a MetricsRecorder to log those metrics

Types

type MetricsRecorder added in v0.6.2

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