flash

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMessage

func AddMessage(c *fiber.Ctx, severity Severity, text string) *fiber.Ctx

AddMessage adds a flash message to the session

func Debug

func Debug(c *fiber.Ctx, text string)

Debug adds a debug message

func Error

func Error(c *fiber.Ctx, text string)

Error adds an error message

func Info

func Info(c *fiber.Ctx, text string)

Info adds an info message

func Middleware

func Middleware() fiber.Handler

Middleware is a Fiber middleware that handles flash messages

func Setup

func Setup(s *session.Store)

Setup initializes the flash message system with a session store

func Success

func Success(c *fiber.Ctx, text string)

Success adds a success message

func Warning

func Warning(c *fiber.Ctx, text string)

Warning adds a warning message

Types

type Callback

type Callback func(*fiber.Ctx)

type Message

type Message struct {
	Text     string   `json:"text"`
	Severity Severity `json:"severity"`
}

Message represents a flash message

type Severity

type Severity string

Severity represents the severity level of a flash message

const (
	DEBUG   Severity = "DEBUG"
	INFO    Severity = "INFO"
	SUCCESS Severity = "SUCCESS"
	WARNING Severity = "WARNING"
	ERROR   Severity = "ERROR"
)

func (Severity) String

func (s Severity) String() string

String implements the Stringer interface for Severity

Jump to

Keyboard shortcuts

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