Documentation
¶
Index ¶
- func AddLoggingFields(kvs map[string]interface{})
- func AddSkipLoggingMethods(methodNames ...string)
- func AddSkipMethods(routers ...string)
- func ContextTimeout() grpc.UnaryClientInterceptor
- func GetAuthScheme() string
- func JwtVerify(ctx context.Context) (context.Context, error)
- func StreamClientTracing() grpc.StreamClientInterceptor
- func StreamContextTimeout() grpc.StreamClientInterceptor
- func StreamServerTracing() grpc.StreamServerInterceptor
- func UnaryClientRetry(opts ...Option) grpc.UnaryClientInterceptor
- func UnaryClientTracing() grpc.UnaryClientInterceptor
- func UnaryServerCtxTags() grpc.UnaryServerInterceptor
- func UnaryServerJwtAuth() grpc.UnaryServerInterceptor
- func UnaryServerRecovery() grpc.UnaryServerInterceptor
- func UnaryServerTracing() grpc.UnaryServerInterceptor
- func UnaryServerZapLogging(logger *zap.Logger) grpc.UnaryServerInterceptor
- type Option
- type SkipAuthMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLoggingFields ¶
func AddLoggingFields(kvs map[string]interface{})
AddLoggingFields 添加跳过认证方法,在服务初始化时设置
func AddSkipLoggingMethods ¶
func AddSkipLoggingMethods(methodNames ...string)
AddSkipLoggingMethods 添加跳过打印日志方法,在服务初始化时设置
func StreamClientTracing ¶
func StreamClientTracing() grpc.StreamClientInterceptor
StreamClientTracing 客户端流链路跟踪
func StreamContextTimeout ¶
func StreamContextTimeout() grpc.StreamClientInterceptor
StreamContextTimeout 流式调用超时中间件
func StreamServerTracing ¶
func StreamServerTracing() grpc.StreamServerInterceptor
StreamServerTracing 服务端流链路跟踪
func UnaryClientRetry ¶
func UnaryClientRetry(opts ...Option) grpc.UnaryClientInterceptor
UnaryClientRetry 重试
func UnaryClientTracing ¶
func UnaryClientTracing() grpc.UnaryClientInterceptor
UnaryClientTracing 客户端一元链路跟踪
func UnaryServerCtxTags ¶
func UnaryServerCtxTags() grpc.UnaryServerInterceptor
UnaryServerCtxTags field extractor logging
func UnaryServerJwtAuth ¶
func UnaryServerJwtAuth() grpc.UnaryServerInterceptor
UnaryServerJwtAuth jwt认证拦截器
func UnaryServerRecovery ¶
func UnaryServerRecovery() grpc.UnaryServerInterceptor
UnaryServerRecovery 发生panic时恢复
func UnaryServerTracing ¶
func UnaryServerTracing() grpc.UnaryServerInterceptor
UnaryServerTracing 服务端一元链路跟踪
func UnaryServerZapLogging ¶
func UnaryServerZapLogging(logger *zap.Logger) grpc.UnaryServerInterceptor
UnaryServerZapLogging 日志打印拦截器
Types ¶
type Option ¶
type Option func(*options)
Option set the retry options.
func WithRetryErrCodes ¶
WithRetryErrCodes 设置触发重试错误码
func WithRetryInterval ¶
WithRetryInterval 设置重试时间间隔,范围1毫秒到10秒
type SkipAuthMethod ¶
type SkipAuthMethod struct{}
SkipAuthMethod 跳过认证,嵌入服务
func (*SkipAuthMethod) AuthFuncOverride ¶
func (s *SkipAuthMethod) AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error)
AuthFuncOverride 重写认证方法
Click to show internal directories.
Click to hide internal directories.