middleware

package
v2.2.14 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(mw ...middleware) func(http.Handler) http.Handler

Append returns a new handler with the provided middleware, executed in order

func Logger

func Logger(next http.Handler) http.Handler

Logger logs the request and response

func ProjectIDValidator

func ProjectIDValidator(next http.Handler) http.Handler

ProjectIDValidator validates the project ID in the request header It returns a Bad Request error if the project ID is missing or invalid

func RequestDurationMetrics

func RequestDurationMetrics(duration prometheus.Histogram, next http.Handler) http.Handler

RequestDurationMetrics measures the duration of the request and records it for Prometheus

func ResponseCounterMetrics

func ResponseCounterMetrics(counter *prometheus.CounterVec, next http.Handler) http.Handler

ResponseCounterMetrics counts the number of responses and records it for Prometheus

func RewriteProjectScopedPath added in v2.2.11

func RewriteProjectScopedPath(next http.Handler) http.Handler

RewriteProjectScopedPath maps /vN/projects/{projectName}/... requests onto the existing /vN/... API surface after project resolution has already happened.

Types

This section is empty.

Jump to

Keyboard shortcuts

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