middleware

package
v1.0.0-preupgrade Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestMonitoringMiddleware

func RequestMonitoringMiddleware(metrics HTTPAPIMetrics) gin.HandlerFunc

func RequestSizeLimiterMiddleware

func RequestSizeLimiterMiddleware(limitBytes int64) gin.HandlerFunc

RequestSizeLimiterMiddleware returns a middleware that limits all incoming request sized to be below (or equal to) the configured limitBytes. Negative limits are treated as `0`, see http.MaxBytesReader for more details. Must be used before any middleware that reads the request body, otherwise the limit will not strictly be enforced.

Types

type HTTPAPIMetrics

type HTTPAPIMetrics interface {
	IncrementActiveRequestsCounter(ctx context.Context)
	DecrementActiveRequestsCounter(ctx context.Context)
	RecordHTTPRequestDuration(ctx context.Context, duration time.Duration, path, method string, status int)
}

HTTPAPIMetrics captures a subset of metrics that are used for monitoring the HTTP API. It is implemented by the global common.EDSMetricLabeler

Jump to

Keyboard shortcuts

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