mid

package
v0.0.0-...-9790b92 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

middleware package From the follwing sources: https://blog.questionable.services/article/guide-logging-middleware-go/ https://lets-go.alexedwards.net/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(e *env.Env, ur user.RepositoryDb) func(http.Handler) http.Handler

func LogRequest

func LogRequest(log *log.Logger) func(http.Handler) http.Handler

LogRequest logs information about each request.

func NoSurf

func NoSurf(next http.Handler) http.Handler

CSRF Protection middleware

func RecoverPanic

func RecoverPanic(log *log.Logger) func(http.Handler) http.Handler

RecoverPanic closes a connection and returns an error response.

func RequireAuthentication

func RequireAuthentication(e *env.Env) func(http.Handler) http.Handler

RequireAuthentication checks if an authenticatedUserID exists on the request.

func SecureHeaders

func SecureHeaders(next http.Handler) http.Handler

SecureHeaders sets header options.

Types

This section is empty.

Jump to

Keyboard shortcuts

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