middlewares

package
v0.0.0-...-c34d2c7 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recovery

type Recovery struct {
	ServiceName     string // for logging
	Logger          *logrus.Entry
	ErrorClient     environments.SentryClient // Can use this to send prod errors to a system
	StackAll        bool
	StackSize       int
	SentryPublicDSN string
}

Recovery is a Negroni middleware that recovers from any panics and writes a 500 if there was one.

func NewRecovery

func NewRecovery(serviceName string, conf environments.Config, sentryPublicDSN string) *Recovery

NewRecovery returns a new instance of Recovery

func (*Recovery) ServeHTTP

func (mw *Recovery) ServeHTTP(res http.ResponseWriter, req *http.Request, next http.HandlerFunc)

Jump to

Keyboard shortcuts

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