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) 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 in-memory session store
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 does nothing here since Set sets the value.
func (*Store) Create ¶
func (s *Store) Create(sess *simplesessions.Session) (string, error)
Create creates a new session id and returns it. This doesn't create the session in sessions map since memory can be saved by not storing empty sessions and system can not be stressed by just creating new sessions
func (*Store) Get ¶
func (s *Store) Get(sess *simplesessions.Session, id, key string) (interface{}, error)
Get gets a field in session
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 present in session then nil is returned.
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.