storage

package
v0.0.0-...-f34d141 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_NAME = "token"
)

Variables

This section is empty.

Functions

func NewDefaultSession

func NewDefaultSession() tokens.TokenStorage

func NewSession

func NewSession(length int, name string, factory tokens.TokenFactory, store sessions.Store) tokens.TokenStorage

Types

type Constant

type Constant struct {
	tokens.Token
}

func NewDefaultConstant

func NewDefaultConstant(t tokens.Token) Constant

func (Constant) Load

func (t Constant) Load(r *http.Request) (tokens.Token, error)

func (Constant) NewToken

func (t Constant) NewToken(w http.ResponseWriter, r *http.Request) tokens.Token

type Session

type Session struct {
	// Length of the token to generate
	Length int

	// Name to store the token session
	// within the request as.
	SessionName string

	// Session storage
	sessions.Store

	// Factory for generating new tokens.
	// Should return pointers to a token.
	Factory tokens.TokenFactory
}

func (Session) Load

func (t Session) Load(r *http.Request) (tokens.Token, error)

func (Session) NewToken

func (t Session) NewToken(w http.ResponseWriter, r *http.Request) tokens.Token

Jump to

Keyboard shortcuts

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