alertManager

package
v0.0.0-...-5dd2f1f Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxAlerts = 10 // define the maximum number of alerts
View Source
const SessionKey = "alerts"

Variables

This section is empty.

Functions

func AddAlert

func AddAlert(c *gin.Context, msg string, typ AlertType)

func AlertMiddleware

func AlertMiddleware(store sessions.Store) gin.HandlerFunc

func ClearAlerts

func ClearAlerts(c *gin.Context)

ClearAlerts This could be a function called after rendering the alerts in the template/view

Types

type Alert

type Alert struct {
	Type    AlertType
	Message string
}

func GetAlerts

func GetAlerts(c *gin.Context) []Alert

type AlertType

type AlertType string
const (
	AlertPrimary   AlertType = "alert-primary"
	AlertSecondary AlertType = "alert-secondary"
	AlertSuccess   AlertType = "alert-success"
	AlertDanger    AlertType = "alert-danger"
	AlertWarning   AlertType = "alert-warning"
	AlertInfo      AlertType = "alert-info"
	AlertLight     AlertType = "alert-light"
	AlertDark      AlertType = "alert-dark"
)

Jump to

Keyboard shortcuts

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