Documentation ¶
Index ¶
- func BreakerInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) error
- func DontLogContentForMethod(method string)
- func DurationInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) error
- func PrometheusInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) 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 any, cc *grpc.ClientConn, ...) error
- func WithCallTimeout(timeout time.Duration) grpc.CallOption
- type TimeoutCallOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BreakerInterceptor ¶
func BreakerInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
BreakerInterceptor is an interceptor that acts as a circuit breaker.
func DontLogContentForMethod ¶ added in v1.4.3
func DontLogContentForMethod(method string)
DontLogContentForMethod disable logging content for given method.
func DurationInterceptor ¶
func DurationInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
DurationInterceptor is an interceptor that logs the processing time.
func PrometheusInterceptor ¶
func PrometheusInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
PrometheusInterceptor is an interceptor that reports to prometheus server.
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)
StreamTracingInterceptor returns a grpc.StreamClientInterceptor for opentelemetry.
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 any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryTracingInterceptor returns a grpc.UnaryClientInterceptor for opentelemetry.
func WithCallTimeout ¶ added in v1.6.0
func WithCallTimeout(timeout time.Duration) grpc.CallOption
WithCallTimeout returns a call option that controls method call timeout.
Types ¶
type TimeoutCallOption ¶ added in v1.6.0
type TimeoutCallOption struct { grpc.EmptyCallOption // contains filtered or unexported fields }
TimeoutCallOption is a call option that controls timeout.