sessions

package
v0.0.0-...-c9b1956 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKeyLen = errors.New("Key length not 16, 24, or 32 bytes long")

Functions

This section is empty.

Types

type Cookie struct {
	// contains filtered or unexported fields
}

func NewCookie

func NewCookie(name string, key []byte) (Cookie, error)

func (*Cookie) AddFlashDanger

func (c *Cookie) AddFlashDanger(w http.ResponseWriter, r *http.Request, msg string) error

func (*Cookie) AddFlashInfo

func (c *Cookie) AddFlashInfo(w http.ResponseWriter, r *http.Request, msg string) error

func (*Cookie) AddFlashSuccess

func (c *Cookie) AddFlashSuccess(w http.ResponseWriter, r *http.Request, msg string) error

func (*Cookie) AddFlashWarning

func (c *Cookie) AddFlashWarning(w http.ResponseWriter, r *http.Request, msg string) error

func (*Cookie) GetSessionValue

func (c *Cookie) GetSessionValue(key, r *http.Request) interface{}

func (*Cookie) IsLoggedIn

func (c *Cookie) IsLoggedIn(w http.ResponseWriter, r *http.Request) bool

func (*Cookie) Logout

func (c *Cookie) Logout(w http.ResponseWriter, r *http.Request) error

func (*Cookie) PopFlashesDanger

func (c *Cookie) PopFlashesDanger(w http.ResponseWriter, r *http.Request) []string

func (*Cookie) PopFlashesInfo

func (c *Cookie) PopFlashesInfo(w http.ResponseWriter, r *http.Request) []string

func (*Cookie) PopFlashesSuccess

func (c *Cookie) PopFlashesSuccess(w http.ResponseWriter, r *http.Request) []string

func (*Cookie) PopFlashesWarning

func (c *Cookie) PopFlashesWarning(w http.ResponseWriter, r *http.Request) []string

func (*Cookie) SessionGetUserId

func (c *Cookie) SessionGetUserId(r *http.Request) (int64, bool)

func (*Cookie) SetLoggedIn

func (c *Cookie) SetLoggedIn(id int64, w http.ResponseWriter, r *http.Request) error

func (*Cookie) SetSessionValue

func (c *Cookie) SetSessionValue(key string, value interface{}, w http.ResponseWriter, r *http.Request) error

Jump to

Keyboard shortcuts

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