recovering

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package recovering implements a middleware for recovering from panics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(options Options) func(http.Handler) http.Handler

Middleware is a middleware for recovering from panics.

Types

type Option added in v0.1.1

type Option func(*Options)

Option is a function that configures the middleware via the functional options pattern.

func WithStackTrace

func WithStackTrace() Option

WithStackTrace configures whether to dump the stack trace after recovering. See the GOTRACEBACK environment variable (https://pkg.go.dev/runtime#hdr-Environment_Variables) on how to configure the stack trace level.

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options provides means to configure the middleware by applying the functional options pattern.

func NewOptions

func NewOptions(options ...Option) *Options

NewOptions creates functionally injectable Options.

Jump to

Keyboard shortcuts

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