flash

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Store = sessions.NewCookieStore([]byte("secret-password"))

Store cookie storage

Functions

func GetCurrentUserName

func GetCurrentUserName(r *http.Request) string

GetCurrentUserName returns the username of the logged in user

func GetFlashMessage

func GetFlashMessage(w http.ResponseWriter, r *http.Request, name string) string

GetFlashMessage get flash msg from session

func GetMessage

func GetMessage(w http.ResponseWriter, r *http.Request) ([]byte, error)

GetMessage get message

func HasFlash

func HasFlash(r *http.Request) bool

HasFlash check if have message

func SetFlashMessage

func SetFlashMessage(w http.ResponseWriter, r *http.Request, name string, value string)

SetFlashMessage set flash msg

func SetMessage

func SetMessage(w http.ResponseWriter, msg string)

SetMessage set message

Types

This section is empty.

Jump to

Keyboard shortcuts

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