serverinterceptors

package
v0.0.0-...-a23f37e Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamRecoverInterceptor

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

StreamRecoverInterceptor catches panics in processing stream requests and recovers.

func StreamTracingInterceptor

func StreamTracingInterceptor(svr any, ss grpc.ServerStream, info *grpc.StreamServerInfo,
	handler grpc.StreamHandler) error

StreamTracingInterceptor returns a grpc.StreamServerInterceptor for opentelemetry.

func UnaryPrometheusInterceptor

func UnaryPrometheusInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

func UnaryRecoverInterceptor

func UnaryRecoverInterceptor(ctx context.Context, req interface{}, info *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) grpc.UnaryServerInterceptor

UnaryTimeoutInterceptor returns a func that sets timeout to incoming unary requests. 返回一个函数 为一元请求 设置超时时间

func UnaryTracingInterceptor

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

UnaryTracingInterceptor is a grpc.UnaryServerInterceptor for opentelemetry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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