serverinterceptors

package
v0.0.0-...-6819526 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

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

type MethodTimeoutConf struct {
	FullMethod string
	Timeout    time.Duration
}

MethodTimeoutConf defines specified timeout for gRPC method.

Jump to

Keyboard shortcuts

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