Documentation ¶
Index ¶
- func BreakerInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func DurationInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func PrometheusInterceptor(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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BreakerInterceptor ¶
func BreakerInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
BreakerInterceptor is an interceptor that acts as a circuit breaker.
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 PrometheusInterceptor ¶ added in v1.0.17
func PrometheusInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
PrometheusInterceptor is an interceptor that reports to prometheus server.
func SetSlowThreshold ¶ added in v1.2.3
SetSlowThreshold sets the slow threshold.
func StreamTracingInterceptor ¶ added in v1.2.0
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 ¶ added in v1.2.0
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.