Documentation
¶
Index ¶
- Constants
- func InternalServerUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (any, error)
- func MaxDeadlineUnaryInterceptor(maxDeadline time.Duration) grpc.UnaryServerInterceptor
- func RejectUnknownFieldsUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (any, error)
- func ServerUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (any, error)
Constants ¶
const ServerElapsedTrailer = "x-server-elapsed-us"
ServerElapsedTrailer carries the server's handler duration in microseconds, so clients can report a latency unaffected by their own scheduling overhead.
Variables ¶
This section is empty.
Functions ¶
func InternalServerUnaryInterceptor ¶
func InternalServerUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
InternalServerUnaryInterceptor is for internal services. A handler's error reaches the caller with the code apierror gives it; any other error, including a status received from an upstream service, is Internal with its full text.
func MaxDeadlineUnaryInterceptor ¶
func MaxDeadlineUnaryInterceptor(maxDeadline time.Duration) grpc.UnaryServerInterceptor
MaxDeadlineUnaryInterceptor returns an interceptor that caps the request context at maxDeadline.
func RejectUnknownFieldsUnaryInterceptor ¶
func RejectUnknownFieldsUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
RejectUnknownFieldsUnaryInterceptor refuses any request carrying a field this binary has no descriptor for, at any level of nesting.
func ServerUnaryInterceptor ¶
func ServerUnaryInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
ServerUnaryInterceptor is for ateapi. A handler's error reaches the caller with the code apierror gives it; any other error, including a status received from an upstream service, is Internal.
Request and response bodies are logged as they are: redaction of debug_redact fields happens in the shared slog handler (internal/contextlogging) that serverboot's InitLogger and InitLoggerWithWriter install as the default logger in every server, so it also covers protos logged anywhere else in the process.
Types ¶
This section is empty.