Documentation
¶
Overview ¶
Module for displaying outputting messages to users in the form of HTML flashes. Also contains functions to redirect requests with flash.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpError ¶
func HttpError(w http.ResponseWriter, code int, text string, level LogLevel, err error, toLog ...any)
Logs and writes error. Accepts http.ResponseWriter, http error code, message text, log level, error and additional parameters of type slog.Attr
func HttpSuccess ¶
func HttpSuccess(w http.ResponseWriter, text string)
Writes 200 OK response with flash message.
func RedirectError ¶
func RedirectError(w http.ResponseWriter, r *http.Request, redirect func(http.ResponseWriter, *http.Request), text string, level LogLevel, err error, toLog ...any)
Logs and redirects error. Besides http.ResponseWriter, *http.Request, and the redirect function, it accepts message text, log level, error and additional parameters of type slog.Attr
func SetSuccessMessage ¶
func SetSuccessMessage(w http.ResponseWriter, text string)
Sets success message on http.ResponseWriter
Types ¶
Click to show internal directories.
Click to hide internal directories.