interceptors

package
v1.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestIDKey = "x-request-id"

RequestIDKey is metadata key name for request ID

Functions

func DatabaseLoggingStreamServerInterceptor added in v1.6.0

func DatabaseLoggingStreamServerInterceptor() grpc.StreamServerInterceptor

DatabaseLoggingStreamServerInterceptor returns a streaming server interceptor. This interceptor extracts the logger from the request context, attaches it to gorm's database connection pool and logs the database queries with their meta-information using the logger.

func DatabaseLoggingUnaryServerInterceptor added in v1.6.0

func DatabaseLoggingUnaryServerInterceptor() grpc.UnaryServerInterceptor

DatabaseLoggingUnaryServerInterceptor returns a unary server interceptor. This interceptor extracts the logger from the request context, attaches it to gorm's database connection pool and logs the database queries with their meta-information using the logger.

func DatabaseStreamServerInterceptor

func DatabaseStreamServerInterceptor(db *gorm.DB) grpc.StreamServerInterceptor

DatabaseStreamServerInterceptor returns a streaming server interceptor that adds gorm.DB to the context.

func DatabaseUnaryServerInterceptor

func DatabaseUnaryServerInterceptor(db *gorm.DB) grpc.UnaryServerInterceptor

DatabaseUnaryServerInterceptor returns a unary server interceptor that adds gorm.DB to the context.

func LoggerStreamServerInterceptor

func LoggerStreamServerInterceptor(logger sdklogger.Logger) grpc.StreamServerInterceptor

LoggerStreamServerInterceptor returns a streaming server interceptor that adds the sdklogger.Logger to the context.

func LoggerUnaryServerInterceptor

func LoggerUnaryServerInterceptor(logger sdklogger.Logger) grpc.UnaryServerInterceptor

LoggerUnaryServerInterceptor returns a unary server interceptors that adds the sdklogger.Logger to the context.

func MetricsStreamServerInterceptor

func MetricsStreamServerInterceptor(metrics sdkmetrics.Metrics) grpc.StreamServerInterceptor

MetricsStreamServerInterceptor returns a streaming server interceptor that adds sdkmetrics.Metrics to the context.

func MetricsUnaryServerInterceptor

func MetricsUnaryServerInterceptor(metrics sdkmetrics.Metrics) grpc.UnaryServerInterceptor

MetricsUnaryServerInterceptor returns a unary server interceptors that adds sdkmetrics.Metrics to the context.

func RecoveryStreamServerInterceptor added in v1.34.0

func RecoveryStreamServerInterceptor() grpc.StreamServerInterceptor

RecoveryStreamServerInterceptor returns a streaming server interceptor that recovers from panics, sends a sentry event, log in fatal level and halts the service. IMPORTANT: This interceptor should be the last one in the interceptor chain.

func RecoveryUnaryServerInterceptor added in v1.34.0

func RecoveryUnaryServerInterceptor() grpc.UnaryServerInterceptor

RecoveryUnaryServerInterceptor returns a unary server interceptor that recovers from panics, sends a sentry event, log in fatal level and halts the service. IMPORTANT: This interceptor should be the last one in the interceptor chain.

func RequestIDStreamServerInterceptor added in v1.7.0

func RequestIDStreamServerInterceptor() grpc.StreamServerInterceptor

func RequestIDUnaryServerInterceptor added in v1.7.0

func RequestIDUnaryServerInterceptor() grpc.UnaryServerInterceptor

func TracingStreamClientInterceptor added in v1.5.0

func TracingStreamClientInterceptor(applicationName string) grpc.StreamClientInterceptor

TracingStreamClientInterceptor returns a stream server interceptor that will trace streaming requests performed by gRPC client.

func TracingStreamServerInterceptor added in v1.5.0

func TracingStreamServerInterceptor(applicationName string) grpc.StreamServerInterceptor

TracingStreamServerInterceptor returns a stream server interceptor that will trace streaming requests to the given gRPC server.

func TracingUnaryClientInterceptor added in v1.5.0

func TracingUnaryClientInterceptor(applicationName string) grpc.UnaryClientInterceptor

TracingUnaryClientInterceptor returns a unary client interceptor that will trace requests performed by gRPC client.

func TracingUnaryServerInterceptor added in v1.5.0

func TracingUnaryServerInterceptor(applicationName string) grpc.UnaryServerInterceptor

TracingUnaryServerInterceptor returns a unary server interceptor that will trace requests to the given gRPC server.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL