Documentation ¶
Index ¶
- func DontLogContentForMethod(method string)
- func SetSlowThreshold(threshold time.Duration)
- func StreamAuthorizeInterceptor(authenticator *auth.Authenticator) grpc.StreamServerInterceptor
- func StreamBreakerInterceptor(svr any, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (err error)
- func StreamRecoverInterceptor(svr any, stream grpc.ServerStream, _ *grpc.StreamServerInfo, ...) (err error)
- func StreamTracingInterceptor(svr any, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryAuthorizeInterceptor(authenticator *auth.Authenticator) grpc.UnaryServerInterceptor
- func UnaryBreakerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (resp any, err error)
- func UnaryPrometheusInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (any, error)
- func UnaryRecoverInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, ...) (resp any, err error)
- func UnarySheddingInterceptor(shedder load.Shedder, metrics *stat.Metrics) grpc.UnaryServerInterceptor
- func UnaryStatInterceptor(metrics *stat.Metrics, conf StatConf) grpc.UnaryServerInterceptor
- func UnaryTimeoutInterceptor(timeout time.Duration, methodTimeouts ...MethodTimeoutConf) grpc.UnaryServerInterceptor
- func UnaryTracingInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (any, error)
- type MethodTimeoutConf
- type StatConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DontLogContentForMethod ¶
func DontLogContentForMethod(method string)
DontLogContentForMethod disable logging content for given method. Deprecated: use StatConf instead.
func SetSlowThreshold ¶
SetSlowThreshold sets the slow threshold. Deprecated: use StatConf instead.
func StreamAuthorizeInterceptor ¶
func StreamAuthorizeInterceptor(authenticator *auth.Authenticator) grpc.StreamServerInterceptor
StreamAuthorizeInterceptor returns a func that uses given authenticator in processing stream requests.
func StreamBreakerInterceptor ¶
func StreamBreakerInterceptor(svr any, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
StreamBreakerInterceptor is an interceptor that acts as a circuit breaker.
func StreamRecoverInterceptor ¶ added in v1.100.8
func StreamRecoverInterceptor(svr any, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
StreamRecoverInterceptor catches panics in processing stream requests and recovers.
func StreamTracingInterceptor ¶
func StreamTracingInterceptor(svr any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamTracingInterceptor returns a grpc.StreamServerInterceptor for opentelemetry.
func UnaryAuthorizeInterceptor ¶
func UnaryAuthorizeInterceptor(authenticator *auth.Authenticator) grpc.UnaryServerInterceptor
UnaryAuthorizeInterceptor returns a func that uses given authenticator in processing unary requests.
func UnaryBreakerInterceptor ¶
func UnaryBreakerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)
UnaryBreakerInterceptor is an interceptor that acts as a circuit breaker.
func UnaryPrometheusInterceptor ¶
func UnaryPrometheusInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
UnaryPrometheusInterceptor reports the statistics to the prometheus server.
func UnaryRecoverInterceptor ¶ added in v1.100.8
func UnaryRecoverInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)
UnaryRecoverInterceptor catches panics in processing unary requests and recovers.
func UnarySheddingInterceptor ¶
func UnarySheddingInterceptor(shedder load.Shedder, metrics *stat.Metrics) grpc.UnaryServerInterceptor
UnarySheddingInterceptor returns a func that does load shedding on processing unary requests.
func UnaryStatInterceptor ¶
func UnaryStatInterceptor(metrics *stat.Metrics, conf StatConf) grpc.UnaryServerInterceptor
UnaryStatInterceptor returns a func that uses given metrics to report stats.
func UnaryTimeoutInterceptor ¶
func UnaryTimeoutInterceptor(timeout time.Duration, methodTimeouts ...MethodTimeoutConf) grpc.UnaryServerInterceptor
UnaryTimeoutInterceptor returns a func that sets timeout to incoming unary requests.
func UnaryTracingInterceptor ¶
func UnaryTracingInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
UnaryTracingInterceptor is a grpc.UnaryServerInterceptor for opentelemetry.
Types ¶
type MethodTimeoutConf ¶ added in v1.100.8
MethodTimeoutConf defines specified timeout for gRPC method.