Documentation ¶
Index ¶
- Variables
- type Provider
- func (mp *Provider) SessionAll() int
- func (mp *Provider) SessionDestroy(sid string) error
- func (mp *Provider) SessionExist(sid string) bool
- func (mp *Provider) SessionGC()
- func (mp *Provider) SessionInit(maxlifetime int64, savePath string) error
- func (mp *Provider) SessionRead(sid string) (session.Store, error)
- func (mp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error)
- type SessionStore
- func (st *SessionStore) Delete(key interface{}) error
- func (st *SessionStore) Flush() error
- func (st *SessionStore) Get(key interface{}) interface{}
- func (st *SessionStore) SessionID() string
- func (st *SessionStore) SessionRelease(w http.ResponseWriter)
- func (st *SessionStore) Set(key, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // TableName store the session in MySQL TableName = mysql.TableName )
Functions ¶
This section is empty.
Types ¶
type Provider ¶
Provider mysql session provider
func (*Provider) SessionAll ¶
SessionAll count values in mysql session
func (*Provider) SessionDestroy ¶
SessionDestroy delete mysql session by sid
func (*Provider) SessionExist ¶
SessionExist check mysql session exist
func (*Provider) SessionGC ¶
func (mp *Provider) SessionGC()
SessionGC delete expired values in mysql session
func (*Provider) SessionInit ¶
SessionInit init mysql session. savepath is the connection string of mysql.
func (*Provider) SessionRead ¶
SessionRead get mysql session by sid
type SessionStore ¶
type SessionStore mysql.SessionStore
SessionStore mysql session store
func (*SessionStore) Delete ¶
func (st *SessionStore) Delete(key interface{}) error
Delete value in mysql session
func (*SessionStore) Flush ¶
func (st *SessionStore) Flush() error
Flush clear all values in mysql session
func (*SessionStore) Get ¶
func (st *SessionStore) Get(key interface{}) interface{}
Get value from mysql session
func (*SessionStore) SessionID ¶
func (st *SessionStore) SessionID() string
SessionID get session id of this mysql session store
func (*SessionStore) SessionRelease ¶
func (st *SessionStore) SessionRelease(w http.ResponseWriter)
SessionRelease save mysql session values to database. must call this method to save values to database.
func (*SessionStore) Set ¶
func (st *SessionStore) Set(key, value interface{}) error
Set value in mysql session. it is temp value in map.