Documentation ¶
Index ¶
- Constants
- Variables
- type CacheEntry
- type Codec
- type KeyFielder
- type MemEntry
- type MemSessions
- func (m *MemSessions) Close() error
- func (m *MemSessions) Delete(uuid string) error
- func (m *MemSessions) IsInUse(uuid string) (bool, error)
- func (m *MemSessions) New(uuid string) (Session, error)
- func (m *MemSessions) Restore(uuid string) (Session, error)
- func (m *MemSessions) Return(s Session) error
- func (m *MemSessions) Ttl(uuid string) (time.Time, error)
- type MsgPackCodec
- type Ordered
- type Session
- type SessionBoltDB
- type Sessions
- type SessionsBoltDB
- func (s *SessionsBoltDB) Close() error
- func (s *SessionsBoltDB) Delete(uuid string) error
- func (s *SessionsBoltDB) IsInUse(uuid string) (bool, error)
- func (s *SessionsBoltDB) New(uuid string) (Session, error)
- func (s *SessionsBoltDB) Restore(uuid string) (Session, error)
- func (s *SessionsBoltDB) Return(session Session) error
- func (s *SessionsBoltDB) Ttl(uuid string) (time.Time, error)
- type Transaction
Constants ¶
View Source
const ErrCantDecData = "can't decode the data"
ErrCantDecData is an error.
View Source
const ErrInvData = "invalid data"
View Source
const ErrItemFound = "item found"
View Source
const ErrIterStop = "iter stop"
View Source
const ErrNotFound = "not found"
View Source
const ErrSessExpired = "session expired"
View Source
const ErrSessFound = "session found"
View Source
const ErrSessInUse = "session is in use"
View Source
const ErrSessNotFound = "session not found"
View Source
const ErrSessionCantStoredat = "can't store data"
View Source
const ErrSessionDataKeyExist = "session data key exist"
View Source
const ErrSessionDataNotFound = "session data not found"
View Source
const ErrUUIDDup = "uuid duplicated"
ErrUUIDDup is the error for duplicated uuid.
Variables ¶
View Source
var DefaultCodec = MsgPackCodec{}
DefaultCodec if the default msgpack codec.
Functions ¶
This section is empty.
Types ¶
type CacheEntry ¶
type CacheEntry struct { Sess Session Store map[string]interface{} ID string // contains filtered or unexported fields }
func (*CacheEntry) Del ¶
func (c *CacheEntry) Del(key string) error
func (*CacheEntry) Get ¶
func (c *CacheEntry) Get(key string) (interface{}, error)
func (*CacheEntry) Set ¶
func (c *CacheEntry) Set(key string, data interface{}) error
func (*CacheEntry) UUID ¶
func (c *CacheEntry) UUID() string
type KeyFielder ¶
type MemEntry ¶
type MemSessions ¶
type MemSessions struct {
// contains filtered or unexported fields
}
func (*MemSessions) Close ¶
func (m *MemSessions) Close() error
func (*MemSessions) Delete ¶
func (m *MemSessions) Delete(uuid string) error
func (*MemSessions) Return ¶
func (m *MemSessions) Return(s Session) error
type MsgPackCodec ¶
type MsgPackCodec struct{}
MsgPackCodec implements the encoder and the decoder that is compatible with Codec interface.
func (MsgPackCodec) Decode ¶
func (m MsgPackCodec) Decode(b []byte) (interface{}, error)
Decode something.
func (MsgPackCodec) Encode ¶
func (m MsgPackCodec) Encode(val interface{}) ([]byte, error)
Encode something.
type Ordered ¶
type Ordered []interface{}
type Session ¶
type Session interface { UUID() string Get(key string) (interface{}, error) Set(key string, data interface{}) error Del(key string) error }
func NewCachedEntry ¶
func NewMemEntry ¶
type SessionBoltDB ¶
type SessionBoltDB struct {
// contains filtered or unexported fields
}
SessionBoltDB represente a session.
func (*SessionBoltDB) Del ¶
func (s *SessionBoltDB) Del(uuid string) error
Del deletes something under the key.
func (*SessionBoltDB) Get ¶
func (s *SessionBoltDB) Get(key string) (interface{}, error)
Get restore something under the key.
func (*SessionBoltDB) Set ¶
func (s *SessionBoltDB) Set(key string, data interface{}) error
Set store data under the name of key.
type Sessions ¶
type Sessions interface { New(uuid string) (Session, error) Restore(uuid string) (Session, error) Delete(uuid string) error Return(s Session) error IsInUse(uuid string) (bool, error) Ttl(uuid string) (time.Time, error) Close() error }
func NewMemSessions ¶
type SessionsBoltDB ¶
type SessionsBoltDB struct {
// contains filtered or unexported fields
}
SessionsBoltDB represente a group of sessions.
func (*SessionsBoltDB) IsInUse ¶
func (s *SessionsBoltDB) IsInUse(uuid string) (bool, error)
IsInUse checks is session is in use by someone.
func (*SessionsBoltDB) New ¶
func (s *SessionsBoltDB) New(uuid string) (Session, error)
New creates a new session.
func (*SessionsBoltDB) Restore ¶
func (s *SessionsBoltDB) Restore(uuid string) (Session, error)
Restore a existent session and update the ttl and in use flag.
func (*SessionsBoltDB) Return ¶
func (s *SessionsBoltDB) Return(session Session) error
Return remove session from in use pool.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction() *Transaction
func (*Transaction) Del ¶
func (t *Transaction) Del(key interface{}) error
Click to show internal directories.
Click to hide internal directories.