middleware

package
v0.0.0-...-96f3e5c Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(h http.Handler, authMap AuthMap, rl *rate.Limiter, l zerolog.Logger) http.Handler

Wrap wraps an http handler with middleware to add instrumentation, error handling, authentication, and rate limiting.

Types

type AuthMap

type AuthMap map[string]string

AuthMap maps from opaque token value to client ID.

func ParseAuthMap

func ParseAuthMap(tokenConfig string) (AuthMap, error)

ParseAuthMap takes a slice of token strings in "client-id:token-value" form and returns a mapping from token value to client ID.

Jump to

Keyboard shortcuts

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