Documentation ¶
Index ¶
- type Store
- func (s *Store) Bool(r interface{}, err error) (bool, error)
- func (s *Store) Bytes(r interface{}, err error) ([]byte, error)
- func (s *Store) Clear(sess *simplesessions.Session, id string) error
- func (s *Store) Commit(sess *simplesessions.Session, id string) error
- func (s *Store) Create(sess *simplesessions.Session) (string, error)
- func (s *Store) Delete(sess *simplesessions.Session, id string, key string) error
- func (s *Store) Float64(r interface{}, err error) (float64, error)
- func (s *Store) Get(sess *simplesessions.Session, id, key string) (interface{}, error)
- func (s *Store) GetAll(sess *simplesessions.Session, id string) (map[string]interface{}, error)
- func (s *Store) GetMulti(sess *simplesessions.Session, id string, keys ...string) (map[string]interface{}, error)
- func (s *Store) Int(r interface{}, err error) (int, error)
- func (s *Store) Int64(r interface{}, err error) (int64, error)
- func (s *Store) IsValid(sess *simplesessions.Session, id string) (bool, error)
- func (s *Store) Set(sess *simplesessions.Session, id, key string, val interface{}) error
- func (s *Store) SetPrefix(val string)
- func (s *Store) SetTTL(d time.Duration)
- func (s *Store) String(r interface{}, err error) (string, error)
- func (s *Store) UInt64(r interface{}, err error) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents redis session store for simple sessions. Each session is stored as redis hashmap.
func (*Store) Clear ¶
func (s *Store) Clear(sess *simplesessions.Session, id string) error
Clear clears session in redis.
func (*Store) Commit ¶
func (s *Store) Commit(sess *simplesessions.Session, id string) error
Commit sets all set values
func (*Store) Create ¶
func (s *Store) Create(sess *simplesessions.Session) (string, error)
Create returns a new session id but doesn't stores it in redis since empty hashmap can't be created.
func (*Store) Get ¶
func (s *Store) Get(sess *simplesessions.Session, id, key string) (interface{}, error)
Get gets a field in hashmap. If field is nill then ErrFieldNotFound is raised
func (*Store) GetMulti ¶
func (s *Store) GetMulti(sess *simplesessions.Session, id string, keys ...string) (map[string]interface{}, error)
GetMulti gets a map for values for multiple keys. If key is not found then its set as nil.
func (*Store) Set ¶
func (s *Store) Set(sess *simplesessions.Session, id, key string, val interface{}) error
Set sets a value to given session but stored only on commit
Click to show internal directories.
Click to hide internal directories.