recovering

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 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.

func WithStackTrace

func WithStackTrace() func(*Options)

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.

Types

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 ...func(*Options)) *Options

NewOptions creates functionally injectable Options.

Jump to

Keyboard shortcuts

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