interceptors

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID(md metadata.MD) string

getRequestID extracts request ID from metadata.

func LoggingInterceptor

func LoggingInterceptor(log logger.Logger) grpc.UnaryServerInterceptor

LoggingInterceptor logs each incoming gRPC request with duration and status. It uses the provided logger to log the information.

func RecoverInterceptor

func RecoverInterceptor(log logger.Logger) grpc.UnaryServerInterceptor

RecoverInterceptor returns a unary interceptor that recovers from panics and converts them into gRPC internal errors with stack trace logging.

func RequestIDInterceptor

func RequestIDInterceptor() grpc.UnaryServerInterceptor

RequestIDInterceptor ensures that a request ID is present in the context metadata. If one is missing, it generates a new UUID and injects it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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