middleware

package
v0.0.0-...-89805ac Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errors

func Errors() framework.Middleware

Errors handles errors coming out of the call stack. It detects safe application errors (aka SafeError) that are used to respond to the requester in a normalized way. Unexpected errors (status >= 500) are logged.

func Logger

func Logger() framework.Middleware

Logger logs request info before and after a handler runs. logs to to stdout in the following format: Before:

TraceID : (StatusCode) HTTPMethod Path -> IPAddr (latency)
e.g. 12345 : (200) GET /users/1 -> 192.168.1.0 (4ms)

After:

TODO: add after format
TODO: add after example

TODO: make logging output configurable

func Metrics

func Metrics() framework.Middleware

func Panics

func Panics() framework.Middleware

Panics recovers from panics and converts the panic into an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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