xinterceptor

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoLogKey 忽略请求响应日志打印 key
	NoLogKey = "X-No-Log"
	// NoLogFlag 忽略请求响应日志打印 flag
	NoLogFlag = "true"
)

Variables

View Source
var ErrRPCNotAllowed = bizerr.ErrRPCNotAllowed

ErrRPCNotAllowed 暂不支持该 RPC 错误

Functions

func FuncDisableInterceptor

func FuncDisableInterceptor(fd *disabler.FuncDisabler) grpc.UnaryServerInterceptor

FuncDisableInterceptor 功能禁用服务端一元拦截器

func FuncDisableStreamInterceptor

func FuncDisableStreamInterceptor(fd *disabler.FuncDisabler) grpc.StreamServerInterceptor

FuncDisableStreamInterceptor 功能禁用服务端流拦截器

func JWTClientInterceptor

func JWTClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

JWTClientInterceptor JWT 客户端一元拦截器

func JWTInterceptor

func JWTInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

JWTInterceptor JWT 服务端一元拦截器

func JWTStreamClientInterceptor

func JWTStreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

JWTStreamClientInterceptor JWT 客户端流拦截器

func JWTStreamInterceptor

func JWTStreamInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

JWTStreamInterceptor JWT 服务端流拦截器

func LogInterceptor

func LogInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

LogInterceptor 请求响应日志打印服务端一元拦截器

func NoLog

func NoLog(ctx context.Context) context.Context

NoLog 忽略 grpc 服务端的请求响应日志打印

func RecoverInterceptor

func RecoverInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)

RecoverInterceptor 恐慌捕获恢复服务端一元拦截器

func RecoverStreamInterceptor

func RecoverStreamInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)

RecoverStreamInterceptor 恐慌捕获恢复服务端流拦截器

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL