Versions in this module Expand all Collapse all v1 v1.5.5 Oct 25, 2023 Changes in this version + const ContextRequestIDKey + const HeaderAuthorizationKey + const HeaderXRequestIDKey + var ErrLimitExceed = rl.ErrLimitExceed + var ErrNotAllowed = circuitbreaker.ErrNotAllowed + var RequestIDKey = CtxKeyString(ContextRequestIDKey) + func Auth(opts ...JwtOption) gin.HandlerFunc + func AuthCustom(verify VerifyCustomFn, opts ...JwtOption) gin.HandlerFunc + func CircuitBreaker(opts ...CircuitBreakerOption) gin.HandlerFunc + func Cors() gin.HandlerFunc + func CtxRequestID(ctx context.Context) string + func CtxRequestIDField(ctx context.Context) zap.Field + func GCtxRequestID(c *gin.Context) string + func GCtxRequestIDField(c *gin.Context) zap.Field + func HeaderRequestID(c *gin.Context) string + func HeaderRequestIDField(c *gin.Context) zap.Field + func Logging(opts ...Option) gin.HandlerFunc + func RateLimit(opts ...RateLimitOption) gin.HandlerFunc + func RequestID() gin.HandlerFunc + func Tracing(serviceName string, opts ...TraceOption) gin.HandlerFunc + type CircuitBreakerOption func(*circuitBreakerOptions) + func WithGroup(g *group.Group) CircuitBreakerOption + func WithValidCode(code ...int) CircuitBreakerOption + type CtxKeyString string + type JwtOption func(*jwtOptions) + func WithSwitchHTTPCode() JwtOption + func WithVerify(verify VerifyFn) JwtOption + type Option func(*options) + func WithIgnoreRoutes(routes ...string) Option + func WithLog(log *zap.Logger) Option + func WithMaxLen(maxLen int) Option + func WithRequestIDFromContext(name ...string) Option + func WithRequestIDFromHeader(name ...string) Option + type RateLimitOption func(*rateLimitOptions) + func WithBucket(b int) RateLimitOption + func WithCPUQuota(quota float64) RateLimitOption + func WithCPUThreshold(threshold int64) RateLimitOption + func WithWindow(d time.Duration) RateLimitOption + type TraceOption func(*traceConfig) + func WithPropagators(propagators propagation.TextMapPropagator) TraceOption + func WithTracerProvider(provider oteltrace.TracerProvider) TraceOption + type VerifyCustomFn func(claims *jwt.CustomClaims) error + type VerifyFn func(claims *jwt.Claims) error