Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) Clear() error
- func (s *Store) Delete(key interface{}) error
- func (s *Store) Destroy()
- func (s *Store) Get(key interface{}) interface{}
- func (s *Store) GetAll() map[interface{}]interface{}
- func (s *Store) GetInt(key interface{}) int
- func (s *Store) GetString(key interface{}) string
- func (s *Store) ID() string
- func (s *Store) LastAccessedTime() time.Time
- func (s *Store) Set(key interface{}, value interface{}) error
- func (s *Store) SetLastAccessedTime(lastacc time.Time)
- func (s *Store) VisitAll(cb func(k interface{}, v interface{}))
- type Values
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Provider is the redis provider Provider = sessions.NewProvider("redis") // Config is just the Redis(service)' config Config = redis.Config )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store the redis session store
func NewStore ¶
NewStore creates and returns a new store based on the session id(string) and the cookie life duration (time.Duration)
func (*Store) Destroy ¶
func (s *Store) Destroy()
Destroy deletes entirely the session, from the memory, the client's cookie and the store
func (*Store) Get ¶
func (s *Store) Get(key interface{}) interface{}
Get returns the value of an entry by its key
func (*Store) GetAll ¶
func (s *Store) GetAll() map[interface{}]interface{}
GetAll returns all values
func (*Store) GetString ¶
GetString same as Get but returns as string, if nil then returns an empty string
func (*Store) LastAccessedTime ¶
LastAccessedTime returns the last time this session has been used
func (*Store) Set ¶
Set fills the session with an entry, it receives a key and a value returns an error, which is always nil
func (*Store) SetLastAccessedTime ¶
SetLastAccessedTime updates the last accessed time
Click to show internal directories.
Click to hide internal directories.