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 + var ContextRequestIDKey = "request_id" + var ErrLimitExceed = rl.ErrLimitExceed + var ErrNotAllowed = circuitbreaker.ErrNotAllowed + var RequestIDKey = CtxKeyString(ContextRequestIDKey) + func ClientCtxRequestID(ctx context.Context) string + func ClientCtxRequestIDField(ctx context.Context) zap.Field + func ClientOptionTracing() grpc.DialOption + func ClientTokenOption(appID string, appKey string, isSecure bool) grpc.DialOption + func CtxRequestIDField(ctx context.Context) zap.Field + func GetAuthCtxKey() string + func GetAuthorization(token string) string + func GetJwtClaims(ctx context.Context) (*jwt.Claims, bool) + func GetJwtCustomClaims(ctx context.Context) (*jwt.CustomClaims, bool) + func ServerCtxRequestID(ctx context.Context) string + func ServerCtxRequestIDField(ctx context.Context) zap.Field + func ServerOptionTracing() grpc.ServerOption + func SetAuthToCtx(ctx context.Context, authorization string) context.Context + func SetContextRequestIDKey(key string) + func SetJwtTokenToCtx(ctx context.Context, token string) context.Context + func StreamClientCircuitBreaker(opts ...CircuitBreakerOption) grpc.StreamClientInterceptor + func StreamClientLog(logger *zap.Logger, opts ...LogOption) grpc.StreamClientInterceptor + func StreamClientMetrics() grpc.StreamClientInterceptor + func StreamClientRecovery() grpc.StreamClientInterceptor + func StreamClientRequestID() grpc.StreamClientInterceptor + func StreamClientRetry(opts ...RetryOption) grpc.StreamClientInterceptor + func StreamClientTimeout(d time.Duration) grpc.StreamClientInterceptor + func StreamClientTracing() grpc.StreamClientInterceptor + func StreamServerCircuitBreaker(opts ...CircuitBreakerOption) grpc.StreamServerInterceptor + func StreamServerJwtAuth(opts ...AuthOption) grpc.StreamServerInterceptor + func StreamServerLog(logger *zap.Logger, opts ...LogOption) grpc.StreamServerInterceptor + func StreamServerMetrics(opts ...metrics.Option) grpc.StreamServerInterceptor + func StreamServerRateLimit(opts ...RatelimitOption) grpc.StreamServerInterceptor + func StreamServerRecovery() grpc.StreamServerInterceptor + func StreamServerRequestID() grpc.StreamServerInterceptor + func StreamServerSimpleLog(logger *zap.Logger, opts ...LogOption) grpc.StreamServerInterceptor + func StreamServerToken(f CheckToken) grpc.StreamServerInterceptor + func StreamServerTracing() grpc.StreamServerInterceptor + func UnaryClientCircuitBreaker(opts ...CircuitBreakerOption) grpc.UnaryClientInterceptor + func UnaryClientLog(logger *zap.Logger, opts ...LogOption) grpc.UnaryClientInterceptor + func UnaryClientMetrics() grpc.UnaryClientInterceptor + func UnaryClientRecovery() grpc.UnaryClientInterceptor + func UnaryClientRequestID() grpc.UnaryClientInterceptor + func UnaryClientRetry(opts ...RetryOption) grpc.UnaryClientInterceptor + func UnaryClientTimeout(d time.Duration) grpc.UnaryClientInterceptor + func UnaryClientTracing() grpc.UnaryClientInterceptor + func UnaryServerCircuitBreaker(opts ...CircuitBreakerOption) grpc.UnaryServerInterceptor + func UnaryServerJwtAuth(opts ...AuthOption) grpc.UnaryServerInterceptor + func UnaryServerLog(logger *zap.Logger, opts ...LogOption) grpc.UnaryServerInterceptor + func UnaryServerMetrics(opts ...metrics.Option) grpc.UnaryServerInterceptor + func UnaryServerRateLimit(opts ...RatelimitOption) grpc.UnaryServerInterceptor + func UnaryServerRecovery() grpc.UnaryServerInterceptor + func UnaryServerRequestID() grpc.UnaryServerInterceptor + func UnaryServerSimpleLog(logger *zap.Logger, opts ...LogOption) grpc.UnaryServerInterceptor + func UnaryServerToken(f CheckToken) grpc.UnaryServerInterceptor + func UnaryServerTracing() grpc.UnaryServerInterceptor + func WrapServerCtx(ctx context.Context, kvs ...KV) context.Context + type AuthOption func(*authOptions) + func WithAuthClaimsName(claimsName string) AuthOption + func WithAuthIgnoreMethods(fullMethodNames ...string) AuthOption + func WithAuthScheme(scheme string) AuthOption + func WithCustomVerify(verify CustomVerifyFn) AuthOption + func WithStandardVerify(verify StandardVerifyFn) AuthOption + type CheckToken func(appID string, appKey string) error + type CircuitBreakerOption func(*circuitBreakerOptions) + func WithGroup(g *group.Group) CircuitBreakerOption + func WithUnaryServerDegradeHandler(...) CircuitBreakerOption + func WithValidCode(code ...codes.Code) CircuitBreakerOption + type CtxKeyString string + type CustomVerifyFn = func(claims *jwt.CustomClaims, tokenTail32 string) error + type KV struct + Key string + Val interface{} + type LogOption func(*logOptions) + func WithLogFields(kvs map[string]interface{}) LogOption + func WithLogIgnoreMethods(fullMethodNames ...string) LogOption + func WithMarshalFn(fn func(reply interface{}) []byte) LogOption + func WithMaxLen(maxLen int) LogOption + func WithReplaceGRPCLogger() LogOption + 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 RetryOption func(*retryOptions) + func WithRetryErrCodes(errCodes ...codes.Code) RetryOption + func WithRetryInterval(t time.Duration) RetryOption + func WithRetryTimes(n uint) RetryOption + type StandardVerifyFn = func(claims *jwt.Claims, tokenTail32 string) error