Documentation ¶
Index ¶
- Variables
- func SetSlowThreshold(threshold time.Duration)
- func StreamCrashInterceptor(svr interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, ...) (err error)
- func StreamTracingInterceptor(svr interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryCrashInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func UnaryStatInterceptor(metrics *metrics.Metrics) grpc.UnaryServerInterceptor
- func UnaryTimeoutInterceptor(timeout time.Duration) grpc.UnaryServerInterceptor
- func UnaryTracingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func WithStreamServerInterceptors(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption
- func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
Constants ¶
This section is empty.
Variables ¶
View Source
var SlowThreshold = syncx.ForAtomicDuration(defaultSlowThreshold)
Functions ¶
func SetSlowThreshold ¶
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.
Click to show internal directories.
Click to hide internal directories.