middleware

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package middleware provides a set of middleware for the http server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Metrics

func Metrics(next http.Handler) http.Handler

Metrics is middleware which provides tracking of key metrics for incoming HTTP requests.

Types

type Logging

type Logging struct {
	Logger *zerolog.Logger
}

func (Logging) Requests

func (l Logging) Requests(next http.Handler) http.Handler

Requests is middleware to create a request specific logger, which includes the request's method and url as fields. The logger is passed through the request's context This also logs the incoming request.

type Recover

type Recover struct {
	Logger *zerolog.Logger
}

func (Recover) Panics

func (m Recover) Panics(next http.Handler) http.Handler

Panics is middleware for recovering and reporting panics.

Jump to

Keyboard shortcuts

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