sess

package
v0.0.0-...-66ac5e2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

`sess` is a package that makes dealing with sessions in an `echo` application much simplier.

Index

Constants

This section is empty.

Variables

View Source
var SessionName = "_reverb_session"

SessionName is the name of the session cookie that is set. This defaults to "_reverb_session".

View Source
var Store = sessions.NewCookieStore([]byte(os.Getenv("SESSION_SECRET")))

Store is the `github.com/gorilla/sessions` store used to back the session. It defaults to use a cookie store and the ENV variable `SESSION_SECRET`.

Functions

This section is empty.

Types

type Session

type Session struct {
	Session *sessions.Session
	// contains filtered or unexported fields
}

func Get

Get a session using a request and response.

func GetFromCtx

func GetFromCtx(ctx echo.Context) *Session

Get a session using an `echo.Context`.

func (*Session) Delete

func (s *Session) Delete(name interface{})

Delete a value from the current session.

func (*Session) Get

func (s *Session) Get(name interface{}) interface{}

Get a value from the current session

func (*Session) Save

func (s *Session) Save() error

Save the current session

func (*Session) Set

func (s *Session) Set(name, value interface{})

Set a value onto the current session. If a value with that name already exists it will be overridden with the new value.

Jump to

Keyboard shortcuts

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