middleware

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(handler http.Handler) http.Handler

Authenticate handle routes by user's role

func Constraint

func Constraint(handler http.Handler) http.Handler

Constraint process OPTIONS request.

func Context

func Context(handler http.Handler, db *sql.DB, r *render.Render) http.Handler

Context put database and request in r.Context

func CurrentUser

func CurrentUser(r *http.Request) *models.User

CurrentUser read the user from r.Context

func Logger

func Logger(handler http.Handler, logger *durable.Logger) http.Handler

Logger put logger in r.Context

func State

func State(handler http.Handler) http.Handler

State output states of request, e.g.: r.Method, r.URL etc.

Types

This section is empty.

Jump to

Keyboard shortcuts

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