Versions in this module Expand all Collapse all v1 v1.12.1 Dec 19, 2024 v1.12.0 Dec 19, 2024 Changes in this version + const HeaderAuthorizationKey + var ContextRequestIDKey = "request_id" + var ErrLimitExceed = rl.ErrLimitExceed + var ErrNotAllowed = circuitbreaker.ErrNotAllowed + var HeaderXRequestIDKey = "X-Request-Id" + var RequestHeaderKey = "request_header_key" + var RequestIDKey = CtxKeyString(ContextRequestIDKey) + func AdaptCtx(ctx context.Context) (*gin.Context, context.Context) + 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 GetFromCtx(ctx context.Context, key string) interface + func GetFromHeader(ctx context.Context, key string) string + func GetFromHeaders(ctx context.Context, key string) []string + 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(opts ...RequestIDOption) gin.HandlerFunc + func SimpleLog(opts ...Option) gin.HandlerFunc + func Timeout(d time.Duration) gin.HandlerFunc + func Tracing(serviceName string, opts ...TraceOption) gin.HandlerFunc + func WrapCtx(c *gin.Context) context.Context + type CircuitBreakerOption func(*circuitBreakerOptions) + func WithDegradeHandler(handler func(c *gin.Context)) CircuitBreakerOption + 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() Option + func WithRequestIDFromHeader() 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 RequestIDOption func(*requestIDOptions) + func WithContextRequestIDKey(key string) RequestIDOption + func WithHeaderRequestIDKey(key string) RequestIDOption + type TraceOption func(*traceConfig) + func WithPropagators(propagators propagation.TextMapPropagator) TraceOption + func WithTracerProvider(provider oteltrace.TracerProvider) TraceOption + type VerifyCustomFn func(claims *jwt.CustomClaims, tokenTail10 string, c *gin.Context) error + type VerifyFn func(claims *jwt.Claims, tokenTail10 string, c *gin.Context) error