Documentation ¶
Index ¶
- Variables
- type MemorySessionManager
- func (sm *MemorySessionManager) Add(session *Session)
- func (sm *MemorySessionManager) Clean()
- func (sm *MemorySessionManager) CreateSession(userName string, isAdmin bool) (*Session, bool)
- func (sm *MemorySessionManager) Exists(key string) bool
- func (sm *MemorySessionManager) FromBinary(data []byte) *Session
- func (sm *MemorySessionManager) Get(key string) (*Session, error)
- func (sm *MemorySessionManager) GetSessionCount() int
- func (sm *MemorySessionManager) Remove(key string)
- func (sm *MemorySessionManager) ToBinary(session *Session) []byte
- type RedisSessionManager
- func (sm *RedisSessionManager) Add(session *Session)
- func (sm *RedisSessionManager) Clean()
- func (sm *RedisSessionManager) CreateSession(userName string, isAdmin bool) (*Session, bool)
- func (sm *RedisSessionManager) Exists(key string) bool
- func (sm *RedisSessionManager) FromBinary(data []byte) *Session
- func (sm *RedisSessionManager) Get(key string) (*Session, error)
- func (sm *RedisSessionManager) GetSessionCount() int
- func (sm *RedisSessionManager) Remove(key string)
- func (sm *RedisSessionManager) ToBinary(session *Session) []byte
- type Session
- func (s *Session) GetData(key string) interface{}
- func (s *Session) GetID() string
- func (s *Session) GetUserName() string
- func (s *Session) IsAdmin() bool
- func (s *Session) IsLogin() bool
- func (s *Session) SetAdmin(isAdmin bool)
- func (s *Session) SetData(key string, value interface{})
- func (s *Session) SetLogin(isLogin bool)
- func (s *Session) SetUserName(userName string)
- func (s *Session) UpdateLastSeen()
- type SessionManager
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSessionNotFound = errors.New("Session not found")
)
Functions ¶
This section is empty.
Types ¶
type MemorySessionManager ¶
type MemorySessionManager struct {
// contains filtered or unexported fields
}
func NewMemorySessionManager ¶
func NewMemorySessionManager() *MemorySessionManager
NewMemorySessionManager - Create a new MemorySessionManager object
func (*MemorySessionManager) Add ¶
func (sm *MemorySessionManager) Add(session *Session)
func (*MemorySessionManager) Clean ¶
func (sm *MemorySessionManager) Clean()
func (*MemorySessionManager) CreateSession ¶
func (sm *MemorySessionManager) CreateSession(userName string, isAdmin bool) (*Session, bool)
func (*MemorySessionManager) Exists ¶
func (sm *MemorySessionManager) Exists(key string) bool
func (*MemorySessionManager) FromBinary ¶
func (sm *MemorySessionManager) FromBinary(data []byte) *Session
func (*MemorySessionManager) Get ¶
func (sm *MemorySessionManager) Get(key string) (*Session, error)
func (*MemorySessionManager) GetSessionCount ¶
func (sm *MemorySessionManager) GetSessionCount() int
func (*MemorySessionManager) Remove ¶
func (sm *MemorySessionManager) Remove(key string)
func (*MemorySessionManager) ToBinary ¶
func (sm *MemorySessionManager) ToBinary(session *Session) []byte
type RedisSessionManager ¶
type RedisSessionManager struct {
// contains filtered or unexported fields
}
func NewRedisSessionManager ¶
func NewRedisSessionManager(client *redis.Client) *RedisSessionManager
func (*RedisSessionManager) Add ¶
func (sm *RedisSessionManager) Add(session *Session)
func (*RedisSessionManager) Clean ¶
func (sm *RedisSessionManager) Clean()
func (*RedisSessionManager) CreateSession ¶
func (sm *RedisSessionManager) CreateSession(userName string, isAdmin bool) (*Session, bool)
func (*RedisSessionManager) Exists ¶
func (sm *RedisSessionManager) Exists(key string) bool
func (*RedisSessionManager) FromBinary ¶
func (sm *RedisSessionManager) FromBinary(data []byte) *Session
func (*RedisSessionManager) GetSessionCount ¶
func (sm *RedisSessionManager) GetSessionCount() int
func (*RedisSessionManager) Remove ¶
func (sm *RedisSessionManager) Remove(key string)
func (*RedisSessionManager) ToBinary ¶
func (sm *RedisSessionManager) ToBinary(session *Session) []byte
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) GetUserName ¶
func (*Session) SetUserName ¶
func (*Session) UpdateLastSeen ¶
func (s *Session) UpdateLastSeen()
type SessionManager ¶
Click to show internal directories.
Click to hide internal directories.