Documentation ¶
Index ¶
- type BeegoSession
- func (beegosession BeegoSession) Add(w http.ResponseWriter, req *http.Request, key string, value interface{}) error
- func (beegosession BeegoSession) Flash(w http.ResponseWriter, req *http.Request, message session.Message) error
- func (beegosession BeegoSession) Flashes(w http.ResponseWriter, req *http.Request) []session.Message
- func (beegosession BeegoSession) Get(req *http.Request, key string) string
- func (beegosession BeegoSession) Load(req *http.Request, key string, result interface{}) error
- func (beegosession BeegoSession) Middleware(handler http.Handler) http.Handler
- func (beegosession BeegoSession) Pop(w http.ResponseWriter, req *http.Request, key string) string
- func (beegosession BeegoSession) PopLoad(w http.ResponseWriter, req *http.Request, key string, result interface{}) error
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
Click to show internal directories.
Click to hide internal directories.