Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPath = "/" DefaultMaxAge = 60 * 60 * 24 * 30 // 30days )
Defaults for sessions.Options
View Source
const ( DefaultBatchSize = 100 DefaultCheckInterval = time.Minute )
Defaults for reaper.Options
View Source
const (
DefaultBucketName = "sessions"
)
Defaults for store.Options
Variables ¶
This section is empty.
Functions ¶
func CloseAndFree ¶
func CloseAndFree(store *Store)
Types ¶
type Config ¶
type Config struct { // SessionOptions represents options for a session. SessionOptions sessions.Options // DBOptions represents options for a database. DBOptions Options // ReaperOptions represents options for a reaper routine ReaperOptions ROptions }
Config represents a config for a session store.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type Options ¶
type Options struct { // BucketName represents the name of the bucket which contains sessions. BucketName []byte // If FreeDB is true, then after closing DB and store, DB will be deleted. FreeDB bool }
Options represents options for a database.
type ROptions ¶
type ROptions struct { //StartRoutine represents the status of reaper StartRoutine bool // BucketName represents the name of the bucket which contains sessions. BucketName []byte // BatchSize represents the maximum number of sessions which the reaper // process at one time. BatchSize int // CheckInterval represents the interval between the reaper's invocation. CheckInterval time.Duration }
type Session ¶
type Session struct { Values []byte `json:"Values"` ExpiresAt int64 `json:"ExpiresAt"` XXX_unrecognized []byte `json:"-"` }
func GetSession ¶
Session converts the byte slice to the session struct value.
func NewSession ¶
NewSession creates and returns a session data.
func (*Session) GetExpiresAt ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a session store.
func NewStoreWithDB ¶
Opens a db and creates new sesion storage.
func (*Store) Get ¶
Get returns a session for the given name after adding it to the registry.
See gorilla/sessions FilesystemStore.Get().
Click to show internal directories.
Click to hide internal directories.