Documentation ¶
Index ¶
- func GetAuthCtxKey() string
- func GetAuthorization(token string) string
- func JwtVerify(ctx context.Context) (context.Context, error)
- func SteamClientHystrix(commandName string, opts ...hystrix.Option) grpc.StreamClientInterceptor
- func StreamClientMetrics() grpc.StreamClientInterceptor
- func StreamClientRetry(opts ...RetryOption) grpc.StreamClientInterceptor
- func StreamClientTracing() grpc.StreamClientInterceptor
- func StreamServerCtxTags() grpc.StreamServerInterceptor
- func StreamServerJwtAuth(opts ...AuthOption) grpc.StreamServerInterceptor
- func StreamServerLog(logger *zap.Logger, opts ...LogOption) grpc.StreamServerInterceptor
- func StreamServerMetrics(opts ...metrics.MetricsOption) grpc.StreamServerInterceptor
- func StreamServerRateLimit(opts ...RateLimitOption) grpc.StreamServerInterceptor
- func StreamServerRecovery() grpc.StreamServerInterceptor
- func StreamServerTracing() grpc.StreamServerInterceptor
- func StreamTimeout(d time.Duration) grpc.StreamClientInterceptor
- func UnaryClientHystrix(commandName string, opts ...hystrix.Option) grpc.UnaryClientInterceptor
- func UnaryClientLog(logger *zap.Logger, opts ...grpc_zap.Option) grpc.UnaryClientInterceptor
- func UnaryClientMetrics() grpc.UnaryClientInterceptor
- func UnaryClientRetry(opts ...RetryOption) grpc.UnaryClientInterceptor
- func UnaryClientTracing() grpc.UnaryClientInterceptor
- func UnaryServerCtxTags() grpc.UnaryServerInterceptor
- func UnaryServerJwtAuth(opts ...AuthOption) grpc.UnaryServerInterceptor
- func UnaryServerLog(logger *zap.Logger, opts ...LogOption) grpc.UnaryServerInterceptor
- func UnaryServerMetrics(opts ...metrics.MetricsOption) grpc.UnaryServerInterceptor
- func UnaryServerRateLimit(opts ...RateLimitOption) grpc.UnaryServerInterceptor
- func UnaryServerRecovery() grpc.UnaryServerInterceptor
- func UnaryServerTracing() grpc.UnaryServerInterceptor
- func UnaryStreamLog(logger *zap.Logger, opts ...grpc_zap.Option) grpc.StreamClientInterceptor
- func UnaryTimeout(d time.Duration) grpc.UnaryClientInterceptor
- type AuthOption
- type AuthOptions
- type LogOption
- type RateLimitOption
- type RetryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SteamClientHystrix ¶
func SteamClientHystrix(commandName string, opts ...hystrix.Option) grpc.StreamClientInterceptor
SteamClientHystrix 客户端熔断器stream拦截器
func StreamClientMetrics ¶
func StreamClientMetrics() grpc.StreamClientInterceptor
StreamClientMetrics 客户端指标stream拦截器
func StreamClientRetry ¶
func StreamClientRetry(opts ...RetryOption) grpc.StreamClientInterceptor
StreamClientRetry 重试stream拦截器
func StreamClientTracing ¶
func StreamClientTracing() grpc.StreamClientInterceptor
StreamClientTracing 客户端链路跟踪stream拦截器
func StreamServerCtxTags ¶
func StreamServerCtxTags() grpc.StreamServerInterceptor
StreamServerCtxTags extractor field stream拦截器
func StreamServerJwtAuth ¶
func StreamServerJwtAuth(opts ...AuthOption) grpc.StreamServerInterceptor
StreamServerJwtAuth jwt鉴权stream拦截器
func StreamServerLog ¶
func StreamServerLog(logger *zap.Logger, opts ...LogOption) grpc.StreamServerInterceptor
StreamServerLog 服务端日志stream拦截器
func StreamServerMetrics ¶
func StreamServerMetrics(opts ...metrics.MetricsOption) grpc.StreamServerInterceptor
StreamServerMetrics 服务端指标stream拦截器
func StreamServerRateLimit ¶
func StreamServerRateLimit(opts ...RateLimitOption) grpc.StreamServerInterceptor
StreamServerRateLimit 限流stream拦截器
func StreamServerRecovery ¶
func StreamServerRecovery() grpc.StreamServerInterceptor
StreamServerRecovery recovery stream拦截器
func StreamServerTracing ¶
func StreamServerTracing() grpc.StreamServerInterceptor
StreamServerTracing 服务端链路跟踪stream拦截器
func StreamTimeout ¶
func StreamTimeout(d time.Duration) grpc.StreamClientInterceptor
StreamTimeout 超时stream拦截器
func UnaryClientHystrix ¶
func UnaryClientHystrix(commandName string, opts ...hystrix.Option) grpc.UnaryClientInterceptor
UnaryClientHystrix 客户端熔断器unary拦截器
func UnaryClientLog ¶
UnaryClientLog 客户端日志unary拦截器
func UnaryClientMetrics ¶
func UnaryClientMetrics() grpc.UnaryClientInterceptor
UnaryClientMetrics 客户端指标unary拦截器
func UnaryClientRetry ¶
func UnaryClientRetry(opts ...RetryOption) grpc.UnaryClientInterceptor
UnaryClientRetry 重试unary拦截器
func UnaryClientTracing ¶
func UnaryClientTracing() grpc.UnaryClientInterceptor
UnaryClientTracing 客户端链路跟踪unary拦截器
func UnaryServerCtxTags ¶
func UnaryServerCtxTags() grpc.UnaryServerInterceptor
UnaryServerCtxTags extractor field unary拦截器
func UnaryServerJwtAuth ¶
func UnaryServerJwtAuth(opts ...AuthOption) grpc.UnaryServerInterceptor
UnaryServerJwtAuth jwt鉴权unary拦截器
func UnaryServerLog ¶
func UnaryServerLog(logger *zap.Logger, opts ...LogOption) grpc.UnaryServerInterceptor
UnaryServerLog 服务端日志unary拦截器
func UnaryServerMetrics ¶
func UnaryServerMetrics(opts ...metrics.MetricsOption) grpc.UnaryServerInterceptor
UnaryServerMetrics 服务端指标unary拦截器
func UnaryServerRateLimit ¶
func UnaryServerRateLimit(opts ...RateLimitOption) grpc.UnaryServerInterceptor
UnaryServerRateLimit 限流unary拦截器
func UnaryServerRecovery ¶
func UnaryServerRecovery() grpc.UnaryServerInterceptor
UnaryServerRecovery recovery unary拦截器
func UnaryServerTracing ¶
func UnaryServerTracing() grpc.UnaryServerInterceptor
UnaryServerTracing 服务端链路跟踪unary拦截器
func UnaryStreamLog ¶
UnaryStreamLog 客户端日志stream拦截器
func UnaryTimeout ¶
func UnaryTimeout(d time.Duration) grpc.UnaryClientInterceptor
UnaryTimeout 超时unary拦截器
Types ¶
type AuthOption ¶
type AuthOption func(*AuthOptions)
AuthOption 鉴权设置
func WithAuthClaimsName ¶
func WithAuthClaimsName(claimsName string) AuthOption
WithAuthClaimsName 设置鉴权的信息在ctx的key名称
func WithAuthIgnoreMethods ¶
func WithAuthIgnoreMethods(fullMethodNames ...string) AuthOption
WithAuthIgnoreMethods 忽略鉴权的方法 fullMethodName格式: /packageName.serviceName/methodName, 示例/userExample.v1.userExampleService/GetByID
type AuthOptions ¶
type AuthOptions struct {
// contains filtered or unexported fields
}
type LogOption ¶
type LogOption func(*logOptions)
LogOption 日志设置
func WithLogFields ¶
WithLogFields 添加自定义打印字段
func WithLogIgnoreMethods ¶
WithLogIgnoreMethods 忽略打印的方法 fullMethodName格式: /packageName.serviceName/methodName, 示例/userExample.v1.userExampleService/GetByID
type RetryOption ¶
type RetryOption func(*retryOptions)
RetryOption set the retry retryOptions.
func WithRetryErrCodes ¶
func WithRetryErrCodes(errCodes ...codes.Code) RetryOption
WithRetryErrCodes 设置触发重试错误码
func WithRetryInterval ¶
func WithRetryInterval(t time.Duration) RetryOption
WithRetryInterval 设置重试时间间隔,范围1毫秒到10秒