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
Click to show internal directories.
Click to hide internal directories.