session

package
v0.0.0-...-0397089 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Account is the key of account data in the session.
	Account = "Account"
)

Variables

This section is empty.

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(conf *config.Config) echo.MiddlewareFunc

AuthenticationMiddleware is the middleware of session authentication for echo.

func Delete

func Delete(c echo.Context) error

Delete the current session.

func Get

func Get(c echo.Context) *sessions.Session

Get returns a session for the current request.

func GetAccount

func GetAccount(c echo.Context) *model.Account

GetAccount returns account object of session.

func GetValue

func GetValue(c echo.Context, key string) string

GetValue returns value of session.

func Init

func Init(e *echo.Echo, conf *config.Config)

Init initalize session authentication.

func Save

func Save(c echo.Context) error

Save saves the current session.

func SetAccount

func SetAccount(c echo.Context, account *model.Account) error

SetAccount sets account data in session.

func SetValue

func SetValue(c echo.Context, key string, value interface{}) error

SetValue sets a key and a value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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