session

package
v0.0.0-...-f18cc39 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2013 License: BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Overview

An implementation of the gorilla/sessions#Store interface for `babou`

This uses a PostgreSQL database as a storage backend. This allows sessions to be accessed by any instance of `babou` which share a common session encryption key in their configuration.

Index

Constants

View Source
const (
	SESSIONS_TABLE = "http_sessions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseStore

type DatabaseStore struct {
	Codecs  []securecookie.Codec
	Options *sessions.Options
	// contains filtered or unexported fields
}

func NewDatabaseStore

func NewDatabaseStore(keyPairs ...[]byte) *DatabaseStore

func (*DatabaseStore) Get

func (db *DatabaseStore) Get(r *http.Request, name string) (*sessions.Session, error)

Fetches a session for a given name after it has been added to the registry.

func (*DatabaseStore) New

func (db *DatabaseStore) New(r *http.Request, name string) (*sessions.Session, error)

New returns a new session for the given name w/o adding it to the registry.

func (*DatabaseStore) Save

func (db *DatabaseStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error

Jump to

Keyboard shortcuts

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