Documentation
¶
Overview ¶
middleware package From the follwing sources: https://blog.questionable.services/article/guide-logging-middleware-go/ https://lets-go.alexedwards.net/
Index ¶
- func Authenticate(e *env.Env, ur user.UserRepository) func(http.Handler) http.Handler
- func LogRequest(log *log.Logger) func(http.Handler) http.Handler
- func NoSurf(next http.Handler) http.Handler
- func RecoverPanic(log *log.Logger) func(http.Handler) http.Handler
- func RequireAuthentication(e *env.Env) func(http.Handler) http.Handler
- func SecureHeaders(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func LogRequest ¶
LogRequest logs information about each request.
func RecoverPanic ¶
RecoverPanic closes a connection and returns an error response.
func RequireAuthentication ¶
RequireAuthentication checks if an authenticatedUserID exists on the request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.