http

package
v0.0.0-...-a2b067c Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(h http.Handler, mw ...func(http.Handler) http.Handler) http.Handler

Chain applies middleware in order (first argument is innermost).

func ListenAndServe

func ListenAndServe(a *app.App) error

func NewRouter

func NewRouter(a *app.App) http.Handler

func RealIP

func RealIP(next http.Handler) http.Handler

RealIP sets r.RemoteAddr to the client IP from X-Forwarded-For or X-Real-IP headers. Only enable behind a trusted reverse proxy.

func Recoverer

func Recoverer(next http.Handler, logger *slog.Logger) http.Handler

Recoverer recovers from panics, logs the error, and returns 500.

func RequireAdmin

func RequireAdmin(next http.Handler) http.Handler

func SessionAuth

func SessionAuth(db *sql.DB) func(http.Handler) http.Handler

func UserFromContext

func UserFromContext(ctx context.Context) *auth.User

Types

This section is empty.

Jump to

Keyboard shortcuts

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