flash

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlashMessage

func FlashMessage(c *rex.Context, message string, messageType ...FlashMessageType) error

Helper fucntion to set a flash message in session. default messageType is error.

func FlashMessageMiddleware

func FlashMessageMiddleware() rex.Middleware

FlashMessageMiddleware is a middleware that sets the flash message in the context. Flash messages are inserted into the context by calling FlashMessage function. The context variables passed are "flash_message" (string) and "flash_message_type" (string) [success,info,warning,danger]

Types

type Flash

type Flash struct {
	Message string // Message for the flash
	Type    string // success, info, warning, error
}

Flash message types

type FlashMessageType

type FlashMessageType int
const (
	MessageSuccess FlashMessageType = iota
	MessageInfo
	MessageWarning
	MessageError
)

Jump to

Keyboard shortcuts

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