server

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SlowThreshold = syncx.ForAtomicDuration(defaultSlowThreshold)

Functions

func SetSlowThreshold

func SetSlowThreshold(threshold time.Duration)

SetSlowThreshold sets the slow threshold.

func StreamCrashInterceptor

func StreamCrashInterceptor(svr interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo,
	handler grpc.StreamHandler) (err error)

StreamCrashInterceptor 拦截器

func StreamTracingInterceptor

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

func UnaryCrashInterceptor

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

UnaryCrashInterceptor 这是一个一元RPC调用的拦截器

func UnaryStatInterceptor

func UnaryStatInterceptor(metrics *metrics.Metrics) grpc.UnaryServerInterceptor

UnaryStatInterceptor returns a func that uses given metrics to report stats.

func UnaryTimeoutInterceptor

func UnaryTimeoutInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor

func UnaryTracingInterceptor

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

func WithStreamServerInterceptors

func WithStreamServerInterceptors(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption

WithStreamServerInterceptors uses given server stream interceptors.

func WithUnaryServerInterceptors

func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption

WithUnaryServerInterceptors uses given server unary interceptors.

Types

This section is empty.

Jump to

Keyboard shortcuts

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