Documentation ¶
Index ¶
- Constants
- Variables
- func Init(provider string, addr string, options ...string) (err error)
- type MemorySession
- func (m *MemorySession) Del(key string) (err error)
- func (m *MemorySession) Get(key string) (value interface{}, err error)
- func (m *MemorySession) Id() string
- func (m *MemorySession) IsModify() bool
- func (m *MemorySession) Save() (err error)
- func (m *MemorySession) Set(key string, value interface{}) (err error)
- type MemorySessionMgr
- type RedisSession
- type RedisSessionMgr
- type Session
- type SessionMgr
Constants ¶
View Source
const ( SessionFlagNone = iota SessionFlagModify SessionFlagLoad )
Variables ¶
View Source
var ( ErrSessionNotExist = errors.New("session not exists") ErrKeyNotExistInSession = errors.New("key not exists in session") )
Functions ¶
Types ¶
type MemorySession ¶
type MemorySession struct {
// contains filtered or unexported fields
}
func NewMemorySession ¶
func NewMemorySession(id string) *MemorySession
func (*MemorySession) Del ¶
func (m *MemorySession) Del(key string) (err error)
func (*MemorySession) Get ¶
func (m *MemorySession) Get(key string) (value interface{}, err error)
func (*MemorySession) Id ¶
func (m *MemorySession) Id() string
func (*MemorySession) IsModify ¶
func (m *MemorySession) IsModify() bool
func (*MemorySession) Save ¶
func (m *MemorySession) Save() (err error)
func (*MemorySession) Set ¶
func (m *MemorySession) Set(key string, value interface{}) (err error)
type MemorySessionMgr ¶
type MemorySessionMgr struct {
// contains filtered or unexported fields
}
func (*MemorySessionMgr) CreateSession ¶
func (s *MemorySessionMgr) CreateSession() (session Session, err error)
type RedisSession ¶
type RedisSession struct {
// contains filtered or unexported fields
}
func NewRedisSession ¶
func NewRedisSession(id string, pool *redis.Pool) *RedisSession
func (*RedisSession) Del ¶
func (r *RedisSession) Del(key string) error
func (*RedisSession) Get ¶
func (r *RedisSession) Get(key string) (result interface{}, err error)
func (*RedisSession) Id ¶
func (m *RedisSession) Id() string
func (*RedisSession) IsModify ¶
func (m *RedisSession) IsModify() bool
func (*RedisSession) Save ¶
func (r *RedisSession) Save() (err error)
func (*RedisSession) Set ¶
func (r *RedisSession) Set(key string, value interface{}) error
type RedisSessionMgr ¶
type RedisSessionMgr struct {
// contains filtered or unexported fields
}
func (*RedisSessionMgr) CreateSession ¶
func (r *RedisSessionMgr) CreateSession() (session Session, err error)
type Session ¶
type Session interface { Set(key string, value interface{}) error Get(key string) (interface{}, error) Del(key string) error Save() error IsModify() bool Id() string }
func CreateSession ¶
type SessionMgr ¶
type SessionMgr interface { Init(addr string, options ...string) (err error) CreateSession() (session Session, err error) Get(sessionId string) (session Session, err error) }
func NewMemorySessionMgr ¶
func NewMemorySessionMgr() SessionMgr
func NewRedisSessionMgr ¶
func NewRedisSessionMgr() SessionMgr
Click to show internal directories.
Click to hide internal directories.