Documentation ¶
Index ¶
- type MysqlProvider
- func (p *MysqlProvider) Count() int
- func (p *MysqlProvider) Destory(sid string) (err error)
- func (p *MysqlProvider) Exist(sid string) bool
- func (mp *MysqlProvider) GC()
- func (p *MysqlProvider) Init(maxlifetime int64, connStr string) error
- func (p *MysqlProvider) Read(sid string) (session.RawStore, error)
- func (p *MysqlProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
- type MysqlSessionStore
- func (s *MysqlSessionStore) Delete(key interface{}) error
- func (s *MysqlSessionStore) Flush() error
- func (s *MysqlSessionStore) Get(key interface{}) interface{}
- func (s *MysqlSessionStore) ID() string
- func (s *MysqlSessionStore) Release() error
- func (s *MysqlSessionStore) Set(key, val 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
}
MysqlProvider represents a mysql session provider implementation.
func (*MysqlProvider) Count ¶
func (p *MysqlProvider) Count() int
Count counts and returns number of sessions.
func (*MysqlProvider) Destory ¶
func (p *MysqlProvider) Destory(sid string) (err error)
Destory deletes a session by session ID.
func (*MysqlProvider) Exist ¶
func (p *MysqlProvider) Exist(sid string) bool
Exist returns true if session with given ID exists.
func (*MysqlProvider) Init ¶
func (p *MysqlProvider) Init(maxlifetime int64, connStr string) error
Init initializes memory session provider.
func (*MysqlProvider) Read ¶
func (p *MysqlProvider) Read(sid string) (session.RawStore, error)
Read returns raw session store by session ID.
func (*MysqlProvider) Regenerate ¶
func (p *MysqlProvider) Regenerate(oldsid, sid string) (session.RawStore, error)
Regenerate regenerates a session store from old session ID to new one.
type MysqlSessionStore ¶
type MysqlSessionStore struct {
// contains filtered or unexported fields
}
MysqlSessionStore represents a mysql session store implementation.
func (*MysqlSessionStore) Delete ¶
func (s *MysqlSessionStore) Delete(key interface{}) error
Delete delete a key from session.
func (*MysqlSessionStore) Flush ¶
func (s *MysqlSessionStore) Flush() error
Flush deletes all session data.
func (*MysqlSessionStore) Get ¶
func (s *MysqlSessionStore) Get(key interface{}) interface{}
Get gets value by given key in session.
func (*MysqlSessionStore) ID ¶
func (s *MysqlSessionStore) ID() string
ID returns current session ID.
func (*MysqlSessionStore) Release ¶
func (s *MysqlSessionStore) Release() error
Release releases resource and save data to provider.
func (*MysqlSessionStore) Set ¶
func (s *MysqlSessionStore) Set(key, val interface{}) error
Set sets value to given key in session.