interceptors

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package interceptors supplies RPC recovery, logging, and diagnostic plugin-context extraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStreamInterceptors

func DefaultStreamInterceptors(log logging.Logger) []grpc.StreamServerInterceptor

DefaultStreamInterceptors returns the standard interceptor chain for stream RPCs. Order: recovery (outermost) → logging → context (innermost, closest to handler).

func DefaultUnaryInterceptors

func DefaultUnaryInterceptors(log logging.Logger) []grpc.UnaryServerInterceptor

DefaultUnaryInterceptors returns the standard interceptor chain for unary RPCs. Order: recovery (outermost) → logging → context (innermost, closest to handler).

func StreamLogging

func StreamLogging(log logging.Logger) grpc.StreamServerInterceptor

StreamLogging returns a stream interceptor that logs stream open/close with method and duration.

func StreamPanicRecovery

func StreamPanicRecovery(log logging.Logger) grpc.StreamServerInterceptor

StreamPanicRecovery returns a stream server interceptor that recovers from panics, logs the stack trace, and returns a codes.Internal gRPC error.

func StreamPluginContext

func StreamPluginContext() grpc.StreamServerInterceptor

StreamPluginContext returns a stream server interceptor that extracts PluginContext from gRPC metadata and attaches it to the context.

func UnaryLogging

func UnaryLogging(log logging.Logger) grpc.UnaryServerInterceptor

UnaryLogging returns a unary interceptor that logs each RPC call with method, duration, and error.

func UnaryPanicRecovery

func UnaryPanicRecovery(log logging.Logger) grpc.UnaryServerInterceptor

UnaryPanicRecovery returns a unary server interceptor that recovers from panics, logs the stack trace, and returns a codes.Internal gRPC error.

func UnaryPluginContext

func UnaryPluginContext() grpc.UnaryServerInterceptor

UnaryPluginContext returns a unary server interceptor that extracts PluginContext from gRPC metadata and attaches it to the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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