Documentation ¶
Index ¶
- type DeletableSessionStore
- type MySQLStore
- func (m *MySQLStore) Close()
- func (m *MySQLStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (m *MySQLStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (m *MySQLStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (m *MySQLStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (m *MySQLStore) SetSessionToUserID(fn func(*sessions.Session) *int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletableSessionStore ¶
type DeletableSessionStore interface { sessions.Store Delete(r *http.Request, w http.ResponseWriter, s *sessions.Session) error }
DeletableSessionStore is an extension of sessions.Store that also supports a Delete method
type MySQLStore ¶
type MySQLStore struct { Codecs []securecookie.Codec Options *sessions.Options // contains filtered or unexported fields }
MySQLStore acts as a session store based on MySQL. This particular store also allows for identification of the user associated with the session
func NewMySQLStore ¶
func NewMySQLStore(endpoint string, path string, maxAge int, keyPairs ...[]byte) (*MySQLStore, error)
NewMySQLStore connects to the named database, then executes NewMySQLStoreFromConnection
func NewMySQLStoreFromConnection ¶
func NewMySQLStoreFromConnection(db *sql.DB, path string, maxAge int, keyPairs ...[]byte) (*MySQLStore, error)
NewMySQLStoreFromConnection prepares a few statements for interacting with the database, then returns a ready-to-use MySQLStore
func (*MySQLStore) Close ¶
func (m *MySQLStore) Close()
Close cleans up resources used by the MySQLStore (namely: statements, database access)
func (*MySQLStore) Delete ¶
func (m *MySQLStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Delete removes the provided session from the store (database). An error is returned if some database issue occurs while trying to remove the session
func (*MySQLStore) Save ¶
func (m *MySQLStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
func (*MySQLStore) SetSessionToUserID ¶
func (m *MySQLStore) SetSessionToUserID(fn func(*sessions.Session) *int64)