Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggingInterceptor ¶
func LoggingInterceptor(logger *slog.Logger) grpc.UnaryServerInterceptor
LoggingInterceptor is a gRPC unary server interceptor that logs method calls and their durations. It takes a logger instance as input and returns a UnaryServerInterceptor function.
func MetricsInterceptor ¶
func MetricsInterceptor() grpc.UnaryServerInterceptor
func ProfilerMiddleware ¶
Types ¶
type Middleware ¶
Middleware represents a function type that serves as a middleware in an HTTP server. It takes the next http.Handler as a parameter and returns an http.Handler. The middleware function is responsible for intercepting and processing HTTP requests and responses.
func CORSMiddleware ¶
func CORSMiddleware(o cors.Options) Middleware
func LoggingMiddleware ¶
func LoggingMiddleware(logger *slog.Logger) Middleware
LoggingMiddleware represents logging middleware.
func MetricsMiddleware ¶
func MetricsMiddleware() Middleware
MetricsMiddleware represents HTTP metrics collecting middlewares.
func RecoveryMiddleware ¶
func RecoveryMiddleware() Middleware
func RedirectSlashesMiddleware ¶
func RedirectSlashesMiddleware() Middleware
type StreamInterceptor ¶
type StreamInterceptor = grpc.StreamServerInterceptor
StreamInterceptor is an alias for grpc.StreamServerInterceptor. It is used as a middleware to intercept streaming RPC calls in a gRPC server.
type UnaryInterceptor ¶
type UnaryInterceptor = grpc.UnaryServerInterceptor
UnaryInterceptor is an alias for grpc.UnaryServerInterceptor. It is used as a middleware to intercept unary RPC calls in a gRPC server.