datastoreStore

package module
v0.0.0-...-0e37e8a Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

This sessionStore package provides a store implementing the gorilla session store interface and using google datastore as its backend

This package uses the new google.golang.org/appengine import path, not the old appengine path

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatastoreStore

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

Store stores sessions in the App Engine datastore.

func NewDatastoreStore

func NewDatastoreStore(kind string, keyPairs ...[]byte) *DatastoreStore

NewStore returns a new DatastoreStore.

The kind argument is the kind name used to store the session data. If empty it will use "Session".

See NewCookieStore() for a description of the other parameters.

func (*DatastoreStore) Get

func (s *DatastoreStore) Get(r *http.Request, name string) (*sessions.Session, error)

Get returns a session for the given name after adding it to the registry.

See CookieStore.Get().

func (*DatastoreStore) New

func (s *DatastoreStore) New(r *http.Request, name string) (*sessions.Session, error)

New returns a session for the given name without adding it to the registry.

See CookieStore.New().

func (*DatastoreStore) Save

Save adds a single session to the response.

type Session

type Session struct {
	Date  time.Time
	Value []byte
}

Session is used to load and save session data in the datastore.

Jump to

Keyboard shortcuts

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