middleware

package
v0.0.0-...-e2de2ce Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerMiddleware

func LoggerMiddleware(rootLogger *zerolog.Logger) func(next http.Handler) http.Handler

func NewPatternMiddleware

func NewPatternMiddleware(name string) func(next http.Handler) http.Handler

NewPatternMiddleware returns a new prometheus Middleware handler that groups requests by the chi routing pattern. EX: /users/{firstName} instead of /users/bob

func TraceID

func TraceID(next http.Handler) http.Handler

func VersionMiddleware

func VersionMiddleware(next http.Handler) http.Handler

Types

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware is a handler that exposes prometheus metrics for the number of requests, the latency and the response size, partitioned by status code, method and HTTP path.

Jump to

Keyboard shortcuts

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