middleware

package
v0.0.0-...-f68f6f9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 12 Imported by: 0

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