Documentation ¶
Overview ¶
Package postgres contains code that depends on a Postgresql database backend, and github.com/lib/pq
Index ¶
- Constants
- func NewSessionHolder(db *sql.DB) (base.SessionHolder, error)
- type SessionHolder
- func (sh *SessionHolder) Destroy(c web.C, session *base.Session) error
- func (sh *SessionHolder) Get(c web.C, r *http.Request) (*base.Session, error)
- func (sh *SessionHolder) RegenerateId(c web.C, session *base.Session) (string, error)
- func (sh *SessionHolder) ResetTTL(c web.C, session *base.Session) error
- func (sh *SessionHolder) Save(c web.C, session *base.Session) error
Constants ¶
View Source
const ( DEFAULT_SESSION_TIMEOUT = 30 * 24 * 60 * 60 TABLE_DEFINITION = `CREATE TABLE IF NOT EXISTS sessions ( id char(72) PRIMARY KEY, content bytea, expires timestamp with time zone )` )
View Source
const (
PG_UNIQUE_VIOLATION = pq.ErrorCode("23505")
)
Variables ¶
This section is empty.
Functions ¶
func NewSessionHolder ¶
func NewSessionHolder(db *sql.DB) (base.SessionHolder, error)
NewSessionHolder creates a new postgres-backed session holder
Types ¶
type SessionHolder ¶
type SessionHolder struct { base.BaseSessionHolder // contains filtered or unexported fields }
SessionHolder is a Postgres-backed session store. It uses the postgres bytea data type and the gob encoding to store the session
func (*SessionHolder) RegenerateId ¶
Click to show internal directories.
Click to hide internal directories.