middleware

package
v0.0.0-...-a1630c6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewWrapResponseWriter = middleware.NewWrapResponseWriter
	Recoverer             = middleware.Recoverer
	RedirectSlashes       = middleware.RedirectSlashes
	WithValue             = middleware.WithValue
)

Re-export the upstream middleware we use via this namespace.

Functions

func API

func API(next http.Handler) http.Handler

API adds CORS headers.

func AdminArea

func AdminArea(next http.Handler) http.Handler

AdminArea enforces that an admin golfer is logged in.

func Database

func Database(db *sqlx.DB) func(next http.Handler) http.Handler

Database adds the database handle to the context.

func Downtime

func Downtime(http.Handler) http.Handler

Downtime serves a 503 Service Unavailable.

func Golfer

func Golfer(next http.Handler) http.Handler

Golfer adds the golfer to the context if logged in.

func GolferArea

func GolferArea(next http.Handler) http.Handler

GolferArea enforces that a golfer is logged in.

func GolferInfo

func GolferInfo(next http.Handler) http.Handler

GolferInfo adds the GolferInfo object handle to the context.

func Logger

func Logger(next http.Handler) http.Handler

Logger logs each request.

func Session

func Session(next http.Handler) http.Handler

Session creates the session and stores it in the request context.

func Static

func Static(next http.Handler) http.Handler

Static serves static files from either dist or public.

Types

This section is empty.

Jump to

Keyboard shortcuts

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