middleware

package
v0.0.0-...-2e936b0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLog

func AccessLog(log *logger.Logger) web.Middleware

AccessLog writes information about the request to the logs.

func Authenticate

func Authenticate(a auth.Auth) web.Middleware

Authenticate validates a JWT from the `Authoriztion` header.

func Authorize

func Authorize(a auth.Auth, rule string) web.Middleware

Authorize validates that an authenticated user has at least one role from specified list.

func Cors

func Cors(origin string) web.Middleware

func Errors

func Errors(log *logger.Logger) web.Middleware

Errors handle errors coming out of the call chain. It detects normal application errors which are used to respond to the client in a uniform way. Unexpected errors (status >= 500) are logged.

func Metrics

func Metrics() web.Middleware

Metrics update app metrics.

func Panic

func Panic() web.Middleware

Panic recovers from panic and convert panic to 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