recovery

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMiddleware

func HTTPMiddleware(opts ...Option) func(http.Handler) http.Handler

HTTPMiddleware HTTP 中间件:兜底 panic + 将 *errors.Status 写为结构化 JSON 响应。

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor gRPC stream 拦截器:兜底 panic + 将 *errors.Status 转为 gRPC status。

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor gRPC unary 拦截器:兜底 panic + 将 *errors.Status 转为 gRPC status。

Types

type OnPanicFunc

type OnPanicFunc func(ctx context.Context, p any, stack []byte)

type Option

type Option func(*options)

func WithOnPanic

func WithOnPanic(fn OnPanicFunc) Option

Jump to

Keyboard shortcuts

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