Documentation ¶
Index ¶
- Variables
- func DurationInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func SetSlowThreshold(threshold time.Duration)
- func StreamTracingInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func TimeoutInterceptor(timeout time.Duration) grpc.UnaryClientInterceptor
- func UnaryTracingInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func WithStreamClientInterceptors(interceptors ...grpc.StreamClientInterceptor) grpc.DialOption
- func WithUnaryClientInterceptors(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption
Constants ¶
This section is empty.
Variables ¶
View Source
var SlowThreshold = syncx.ForAtomicDuration(defaultSlowThreshold)
Functions ¶
func DurationInterceptor ¶
func DurationInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
DurationInterceptor is an interceptor that logs the processing time.
func SetSlowThreshold ¶
SetSlowThreshold sets the slow threshold.
func StreamTracingInterceptor ¶
func StreamTracingInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
func TimeoutInterceptor ¶
func TimeoutInterceptor(timeout time.Duration) grpc.UnaryClientInterceptor
TimeoutInterceptor is an interceptor that controls timeout.
func UnaryTracingInterceptor ¶
func UnaryTracingInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryTracingInterceptor returns a grpc.UnaryClientInterceptor for opentelemetry.
func WithStreamClientInterceptors ¶
func WithStreamClientInterceptors(interceptors ...grpc.StreamClientInterceptor) grpc.DialOption
WithStreamClientInterceptors uses given client stream interceptors.
func WithUnaryClientInterceptors ¶
func WithUnaryClientInterceptors(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption
WithUnaryClientInterceptors uses given client unary interceptors.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.