Documentation ¶
Index ¶
Constants ¶
View Source
const ( MAX_TIMEOUT = 86400 * 30 // 接近无限时间 SESS_ONLINE_KEY = "onlines" // 在线用户 SESS_TOKEN_KEY = "_token_" SESS_PREFIX = "sess" // 会话缓存前缀 SESS_TIMEOUT = 7200 // 会话缓存时间 SESS_LIST_SEP = ";" // 角色名之间的分隔符 )
Variables ¶
This section is empty.
Functions ¶
func SessListJoin ¶
func SessListSplit ¶
Types ¶
type Session ¶
func NewSession ¶
func NewSession(reg *SessionRegistry, key string) *Session
func (*Session) GetFlashes ¶
数量n为最大取出多少条消息,-1表示所有消息
type SessionRegistry ¶
type SessionRegistry struct { Onlines *redisw.RedisHash *redisw.RedisWrapper // contains filtered or unexported fields }
func NewRegistry ¶
func NewRegistry(params redisw.ConnParams) *SessionRegistry
func (*SessionRegistry) DelSession ¶
func (sr *SessionRegistry) DelSession(token string) bool
func (SessionRegistry) GetKey ¶
func (sr SessionRegistry) GetKey(token string) string
func (*SessionRegistry) GetSession ¶
func (sr *SessionRegistry) GetSession(token string) *Session
Click to show internal directories.
Click to hide internal directories.