wares

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RequestIDHeaderKey = "X-Request-ID"
)

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(u, p string) func(httprouter.Handle) httprouter.Handle

func Logger

func Logging

func Logging(fn httprouter.Handle) httprouter.Handle

func RequestID

func RequestID(fn httprouter.Handle) httprouter.Handle

Request ID Middleware. Checks the X-Request-ID header. If not found, generates a new uuid, and inserts whichever on the context before calling the next function. Should generally be the outermost middleware, so that all other middlewares have a request id available.

Types

type RequestIDContextKey

type RequestIDContextKey struct{}

Jump to

Keyboard shortcuts

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