scs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SCS

type SCS struct {
	*scs.Manager
}

SCS session manager struct for SCS

func New

func New(manager *scs.Manager) *SCS

New initialize session manager for SCS

func (SCS) Add

func (scs SCS) 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 (SCS) Flash

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

Flash add flash message to session data

func (SCS) Flashes

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

Flashes returns a slice of flash messages from session data

func (SCS) Get

func (scs SCS) Get(req *http.Request, key string) string

Get value from session data

func (SCS) Load

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

Load get value from session data and unmarshal it into result

func (SCS) Middleware

func (scs SCS) Middleware(handler http.Handler) http.Handler

Middleware returns a new session manager middleware instance

func (SCS) Pop

func (scs SCS) Pop(w http.ResponseWriter, req *http.Request, key string) string

Pop value from session data

func (SCS) PopLoad

func (scs SCS) 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