Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore store sessin in memory
func (*MemoryStore) Create ¶
func (m *MemoryStore) Create(data interface{}) string
Create new session
func (*MemoryStore) Set ¶
func (m *MemoryStore) Set(id string, data interface{}) error
Set session data
func (*MemoryStore) Udpate ¶
func (m *MemoryStore) Udpate(max int) int
Udpate all sessions, if timeout, delete it update `max` items at most each time.
type SessManager ¶
type SessManager struct {
SessStore
}
SessManager manage all sessions
func GetManager ¶
func GetManager(typ ...StorType) *SessManager
GetManager create an session manager
type SessStore ¶
type SessStore interface { // Get session data Get(id string) interface{} // Set session data Set(id string, data interface{}) error // Update sessions if timeout, delete it Udpate(max int) int // Delete session Delete(id string) interface{} // Create an new session Create(data interface{}) string }
SessStore interface
Click to show internal directories.
Click to hide internal directories.