recovery

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Overview

Package recovery provides panic recovery middleware for HTTP handlers.

Index

Constants

View Source
const MiddlewareType = "recovery"

MiddlewareType is the type constant for recovery middleware

Variables

This section is empty.

Functions

func CreateMiddleware

func CreateMiddleware(_ *types.MiddlewareConfig, runner types.MiddlewareRunner) error

CreateMiddleware is the factory function for recovery middleware. It creates and registers the recovery middleware with the runner.

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware is an HTTP middleware that recovers from panics. When a panic occurs, it logs the error and returns a 500 Internal Server Error response to the client.

Types

type FactoryMiddleware

type FactoryMiddleware struct{}

FactoryMiddleware wraps recovery middleware functionality for the factory pattern.

func (FactoryMiddleware) Close

func (FactoryMiddleware) Close() error

Close cleans up any resources used by the middleware.

func (FactoryMiddleware) Handler

Handler returns the middleware function used by the proxy.

Jump to

Keyboard shortcuts

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