Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPMiddleware ¶
HTTPMiddleware 记录每个 HTTP 请求的 method、path、status、latency 和 request-id。 需放在 recovery 之后、业务 handler 之前,确保 panic 被兜住后仍能记录日志。
func StreamServerInterceptor ¶
func StreamServerInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamServerInterceptor 记录每个 gRPC stream 调用的 method、code、latency。
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
UnaryServerInterceptor 记录每个 gRPC unary 调用的 method、code、latency。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.