middleware

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

Log is a middleware to log the requests.

func NewLog

func NewLog(logger log.Logger) Log

NewLog return a configured middleware to log the requests.

func (*Log) Handler

func (l *Log) Handler(next http.Handler) http.Handler

Handler process and log requests.

type Recover

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

Recover is used to recover from unhandled panics.

func NewRecover

func NewRecover(logger log.Logger, writer *infraHTTP.Writer) (*Recover, error)

NewRecover return a configured middleware to catch panics.

func (*Recover) Handler

func (rec *Recover) Handler(next http.Handler) http.Handler

Handler process the requests and recover from any panic.

Jump to

Keyboard shortcuts

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