redis

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisSessionStore

func NewRedisSessionStore(opts *options.SessionOptions, cookieOpts *options.CookieOptions) (sessions.SessionStore, error)

NewRedisSessionStore initialises a new instance of the SessionStore from the configuration given

Types

type SessionStore

type SessionStore struct {
	CookieCipher  *encryption.Cipher
	CookieOptions *options.CookieOptions
	Client        *redis.Client
}

SessionStore is an implementation of the sessions.SessionStore interface that stores sessions in redis

func (*SessionStore) Clear

func (store *SessionStore) Clear(rw http.ResponseWriter, req *http.Request) error

Clear clears any saved session information for a given ticket cookie from redis, and then clears the session

func (*SessionStore) Load

func (store *SessionStore) Load(req *http.Request) (*sessions.SessionState, error)

Load reads sessions.SessionState information from a ticket cookie within the HTTP request object

func (*SessionStore) Save

Save takes a sessions.SessionState and stores the information from it to redies, and adds a new ticket cookie on the HTTP response writer

type TicketData

type TicketData struct {
	TicketID string
	Secret   []byte
}

TicketData is a structure representing the ticket used in server session storage

Jump to

Keyboard shortcuts

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