Versions in this module Expand all Collapse all v1 v1.4.0 Mar 19, 2026 Changes in this version + func AccessLog(configs ...AccessLogConfig) gin.HandlerFunc + func CORS(config CORSConfig) gin.HandlerFunc + func ClientIPFromRequest(r *http.Request) string + func Compression(configs ...CompressionConfig) gin.HandlerFunc + func ConcurrencyLimit(limit int) gin.HandlerFunc + func ConcurrencyLimitWithConfig(config ConcurrencyLimitConfig) gin.HandlerFunc + func MaxBodySize(limit int64) gin.HandlerFunc + func RateLimit(rps float64) gin.HandlerFunc + func RateLimitWithConfig(config RateLimitConfig) gin.HandlerFunc + func RealIP() gin.HandlerFunc + func RealIPWithConfig(config RealIPConfig) gin.HandlerFunc + func Recovery() gin.HandlerFunc + func RecoveryWithConfig(config RecoveryConfig) gin.HandlerFunc + func RequestID() gin.HandlerFunc + func SecurityHeaders() gin.HandlerFunc + func SecurityHeadersWithConfig(config SecurityHeadersConfig) gin.HandlerFunc + func Timeout(timeout time.Duration) gin.HandlerFunc + func TimeoutWithConfig(config TimeoutConfig) gin.HandlerFunc + func TraceID() gin.HandlerFunc + type AccessLogConfig struct + AllowedContentTypes []string + AllowedRequestHeaders []string + AllowedResponseHeaders []string + CapturePayload bool + Logger LoggerFunc + MaxBodyBytes int64 + Multipart MultipartConfig + PayloadLogLevel string + Redaction RedactionConfig + ShouldCapturePayload func(*gin.Context, int) bool + ShouldLog func(*gin.Context) bool + SkipPaths []string + type CORSConfig struct + AllowCredentials bool + AllowHeaders string + AllowMethods string + AllowOriginFunc func(origin string) bool + AllowOrigins []string + ExposeHeaders string + MaxAge time.Duration + type CompressionConfig struct + AllowedContentTypes []string + ExcludedContentTypes []string + Level int + MinSizeBytes int + ShouldCompress func(*gin.Context, int) bool + type ConcurrencyLimitConfig struct + Limit int + OnRejected func(*gin.Context) + type LoggerFunc func(ctx context.Context, level string, event string, fields map[string]any) + type MultipartCaptureMode string + const MultipartDisabled + const MultipartFormFieldsOnly + const MultipartMetadataOnly + const MultipartSelectedParts + type MultipartConfig struct + MaxPartValueBytes int64 + Mode MultipartCaptureMode + PartAllowlist []string + RedactFilenames bool + type RateLimitConfig struct + Burst int + OnRejected func(*gin.Context) + Rate float64 + type RealIPConfig struct + OnUntrusted func(c *gin.Context, remoteAddr string) + TrustedCIDRs []string + type RecoveryConfig struct + Logger LoggerFunc + OnPanic func(c *gin.Context, recovered any, stack []byte) + type RedactionConfig struct + HashSalt string + MaxValueBytes int + Rules []RedactionRule + type RedactionRule struct + Key string + Scope string + Strategy RedactionStrategy + type RedactionStrategy string + const RedactionDrop + const RedactionHash + const RedactionMask + const RedactionRedact + type SecurityHeadersConfig struct + ContentSecurityPolicy string + HSTS string + PermissionsPolicy string + type TimeoutConfig struct + OnTimeout func(*gin.Context) + Timeout time.Duration