flash

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package flash provides one-time messages for the user.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error is a bootstrap class
	Error = "alert-danger"
	// Success is a bootstrap class
	Success = "alert-success"
	// Notice is a bootstrap class
	Notice = "alert-info"
	// Warning is a bootstrap class
	Warning = "alert-warning"
	// Standard is the default class
	Standard = "alert-box"
)

Functions

func SendFlashes

func SendFlashes(w http.ResponseWriter, r *http.Request, sess Session)

SendFlashes allows retrieval of flash messages for using with Ajax.

Types

type Info

type Info struct {
	Message string
	Class   string
}

Info Flash Message

func PeekFlashes

func PeekFlashes(w http.ResponseWriter, r *http.Request, sess Session) []Info

PeekFlashes returns the flashes without destroying them.

type Session

type Session interface {
	Save(*http.Request, http.ResponseWriter) error
	Flashes(vars ...string) []interface{}
}

Session is an interface for typical sessions

Jump to

Keyboard shortcuts

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