Documentation ¶
Index ¶
- type MysqlProvider
- func (mp *MysqlProvider) SessionAll() int
- func (mp *MysqlProvider) SessionDestroy(sid string) error
- func (mp *MysqlProvider) SessionExist(sid string) bool
- func (mp *MysqlProvider) SessionGC()
- func (mp *MysqlProvider) SessionInit(maxlifetime int64, savePath string) error
- func (mp *MysqlProvider) SessionRead(sid string) (session.SessionStore, error)
- func (mp *MysqlProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error)
- type MysqlSessionStore
- func (st *MysqlSessionStore) Delete(key interface{}) error
- func (st *MysqlSessionStore) Flush() error
- func (st *MysqlSessionStore) Get(key interface{}) interface{}
- func (st *MysqlSessionStore) SessionID() string
- func (st *MysqlSessionStore) SessionRelease(w http.ResponseWriter)
- func (st *MysqlSessionStore) Set(key, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MysqlProvider ¶
type MysqlProvider struct {
// contains filtered or unexported fields
}
mysql session provider
func (*MysqlProvider) SessionAll ¶
func (mp *MysqlProvider) SessionAll() int
count values in mysql session
func (*MysqlProvider) SessionDestroy ¶
func (mp *MysqlProvider) SessionDestroy(sid string) error
delete mysql session by sid
func (*MysqlProvider) SessionExist ¶
func (mp *MysqlProvider) SessionExist(sid string) bool
check mysql session exist
func (*MysqlProvider) SessionGC ¶
func (mp *MysqlProvider) SessionGC()
delete expired values in mysql session
func (*MysqlProvider) SessionInit ¶
func (mp *MysqlProvider) SessionInit(maxlifetime int64, savePath string) error
init mysql session. savepath is the connection string of mysql.
func (*MysqlProvider) SessionRead ¶
func (mp *MysqlProvider) SessionRead(sid string) (session.SessionStore, error)
get mysql session by sid
func (*MysqlProvider) SessionRegenerate ¶
func (mp *MysqlProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error)
generate new sid for mysql session
type MysqlSessionStore ¶
type MysqlSessionStore struct {
// contains filtered or unexported fields
}
mysql session store
func (*MysqlSessionStore) Delete ¶
func (st *MysqlSessionStore) Delete(key interface{}) error
delete value in mysql session
func (*MysqlSessionStore) Flush ¶
func (st *MysqlSessionStore) Flush() error
clear all values in mysql session
func (*MysqlSessionStore) Get ¶
func (st *MysqlSessionStore) Get(key interface{}) interface{}
get value from mysql session
func (*MysqlSessionStore) SessionID ¶
func (st *MysqlSessionStore) SessionID() string
get session id of this mysql session store
func (*MysqlSessionStore) SessionRelease ¶
func (st *MysqlSessionStore) SessionRelease(w http.ResponseWriter)
save mysql session values to database. must call this method to save values to database.
func (*MysqlSessionStore) Set ¶
func (st *MysqlSessionStore) Set(key, value interface{}) error
set value in mysql session. it is temp value in map.
Click to show internal directories.
Click to hide internal directories.