Documentation ¶
Index ¶
- Constants
- func AddSession(session ISession)
- func GetCount() int64
- func RemoveSession(sessionID int64)
- func TraverseDo(f func(ISession, interface{}), paramData interface{})
- type ISession
- type ISessionPool
- type ISessionPoolBuilder
- type Session
- func (s *Session) Get(key string) interface{}
- func (s *Session) ID() string
- func (s *Session) Remove(key string)
- func (s *Session) Set(key string, value interface{})
- func (s *Session) SyncGet(key string) (value interface{})
- func (s *Session) SyncRemove(key string)
- func (s *Session) SyncSet(key string, value interface{})
- func (s *Session) UID() int64
- type SessionMap
- type SessionPool
- func (sessionPool *SessionPool) AddSession(pSession ISession)
- func (sessionPool *SessionPool) GetCount() int64
- func (sessionPool *SessionPool) GetSession(uId int64) ISession
- func (sessionPool *SessionPool) RemoveSession(uid int64)
- func (sessionPool *SessionPool) TraverseDo(f func(ISession, interface{}), paramData interface{})
Constants ¶
View Source
const (
SessionMapsCount int64 = 1000 // 降低锁粒度,提高并发度
)
Variables ¶
This section is empty.
Functions ¶
func AddSession ¶
func AddSession(session ISession)
func RemoveSession ¶
func RemoveSession(sessionID int64)
func TraverseDo ¶
func TraverseDo(f func(ISession, interface{}), paramData interface{})
Types ¶
type ISession ¶
type ISession interface { ID() string UID() int64 SyncSet(key string, value interface{}) SyncGet(key string) (value interface{}) SyncRemove(key string) Set(key string, value interface{}) Get(key string) interface{} Remove(key string) }
func GetSession ¶
type ISessionPool ¶
type ISessionPoolBuilder ¶
type ISessionPoolBuilder interface {
GetSessionPool(int64) ISessionPool
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) SyncRemove ¶
type SessionMap ¶
type SessionMap struct {
// contains filtered or unexported fields
}
func NewSessionMap ¶
func NewSessionMap() (ret *SessionMap)
func (*SessionMap) TraverseDo ¶
func (sessionMap *SessionMap) TraverseDo(f func(ISession, interface{}), paramData interface{})
type SessionPool ¶
type SessionPool struct {
// contains filtered or unexported fields
}
func NewSessionPool ¶
func NewSessionPool() (ret *SessionPool)
func (*SessionPool) AddSession ¶
func (sessionPool *SessionPool) AddSession(pSession ISession)
func (*SessionPool) GetCount ¶
func (sessionPool *SessionPool) GetCount() int64
func (*SessionPool) GetSession ¶
func (sessionPool *SessionPool) GetSession(uId int64) ISession
func (*SessionPool) RemoveSession ¶
func (sessionPool *SessionPool) RemoveSession(uid int64)
func (*SessionPool) TraverseDo ¶
func (sessionPool *SessionPool) TraverseDo(f func(ISession, interface{}), paramData interface{})
Click to show internal directories.
Click to hide internal directories.