beego_session

package
v0.0.0-...-18b4f60 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeegoSession

type BeegoSession struct {
	*beego_session.Manager
}

BeegoSession session manager struct for BeegoSession

func New

func New(engine *beego_session.Manager) *BeegoSession

New initialize session manager for BeegoSession

func (BeegoSession) Add

func (beegosession BeegoSession) Add(w http.ResponseWriter, req *http.Request, key string, value interface{}) error

Add value to session data, if value is not string, will marshal it into JSON encoding and save it into session data.

func (BeegoSession) Flash

func (beegosession BeegoSession) Flash(w http.ResponseWriter, req *http.Request, message session.Message) error

Flash add flash message to session data

func (BeegoSession) Flashes

func (beegosession BeegoSession) Flashes(w http.ResponseWriter, req *http.Request) []session.Message

Flashes returns a slice of flash messages from session data

func (BeegoSession) Get

func (beegosession BeegoSession) Get(req *http.Request, key string) string

Get value from session data

func (BeegoSession) Load

func (beegosession BeegoSession) Load(req *http.Request, key string, result interface{}) error

Load get value from session data and unmarshal it into result

func (BeegoSession) Middleware

func (beegosession BeegoSession) Middleware(handler http.Handler) http.Handler

Middleware returns a new session manager middleware instance

func (BeegoSession) Pop

func (beegosession BeegoSession) Pop(w http.ResponseWriter, req *http.Request, key string) string

Pop value from session data

func (BeegoSession) PopLoad

func (beegosession BeegoSession) PopLoad(w http.ResponseWriter, req *http.Request, key string, result interface{}) error

PopLoad pop value from session data and unmarshal it into result

Jump to

Keyboard shortcuts

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