Documentation ¶
Index ¶
- func StreamRecoverInterceptor(svr any, stream grpc.ServerStream, _ *grpc.StreamServerInfo, ...) (err error)
- func UnaryRecoverInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, ...) (resp any, err error)
- func UnaryTimeoutInterceptor(timeout time.Duration, methodTimeouts ...MethodTimeoutConf) grpc.UnaryServerInterceptor
- type MethodTimeoutConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamRecoverInterceptor ¶
func StreamRecoverInterceptor(svr any, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
StreamRecoverInterceptor catches panics in processing stream requests and recovers.
func UnaryRecoverInterceptor ¶
func UnaryRecoverInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)
UnaryRecoverInterceptor catches panics in processing unary requests and recovers.
func UnaryTimeoutInterceptor ¶
func UnaryTimeoutInterceptor(timeout time.Duration, methodTimeouts ...MethodTimeoutConf) grpc.UnaryServerInterceptor
UnaryTimeoutInterceptor returns a func that sets timeout to incoming unary requests.
Types ¶
type MethodTimeoutConf ¶
MethodTimeoutConf defines specified timeout for gRPC method.
Click to show internal directories.
Click to hide internal directories.