Documentation ¶
Overview ¶
Package rethinkstore is a session store backend for gorilla/sessions using Rethinkdb.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDatabase = errors.New("no databases available")
Functions ¶
This section is empty.
Types ¶
type RethinkSession ¶
type RethinkStore ¶
type RethinkStore struct { Rethink *r.Session // rethink session Table string // table to store sessions in Codecs []securecookie.Codec // session codecs Options *sessions.Options // default configuration DefaultMaxAge int // default TTL for a MaxAge == 0 session }
RethinkStore stores sessions in a rethinkdb backend.
Example ¶
// RethinkStore store, err := NewRethinkStore("127.0.0.1:28015", TestDatabase, TestTable, 5, 5, []byte("secret-key")) if err != nil { panic(err) } defer store.Close()
Output:
func NewRethinkStore ¶
func NewRethinkStore(addr, db, table string, idle, open int, keyPairs ...[]byte) (*RethinkStore, error)
NewRethinkStore returns a new RethinkStore.
Takes in the database address, database name, session table, max idle connections, max open connections, and session key pairs.
func (*RethinkStore) Close ¶
func (s *RethinkStore) Close()
Close closes the underlying Rethink Client.
func (*RethinkStore) Get ¶
Get returns a session for the given name after adding it to the registry.
func (*RethinkStore) New ¶
New returns a session for the given name without adding it to the registry.
func (*RethinkStore) Save ¶
func (s *RethinkStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Save adds a single session to the response.
Click to show internal directories.
Click to hide internal directories.