Documentation ¶
Index ¶
- type Database
- func (db *Database) Acquire(sid string, expires time.Duration) sessions.LifeTime
- func (db *Database) Clear(sid string)
- func (db *Database) Close() error
- func (db *Database) Config() *service.Config
- func (db *Database) Delete(sid string, key string) (deleted bool)
- func (db *Database) Get(sid string, key string) (value interface{})
- func (db *Database) Len(sid string) (n int)
- func (db *Database) Release(sid string)
- func (db *Database) Set(sid string, lifetime sessions.LifeTime, key string, value interface{}, ...)
- func (db *Database) Visit(sid string, cb func(key string, value interface{}))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database the redis back-end session database for the sessions.
func (*Database) Acquire ¶ added in v10.6.0
Acquire receives a session's lifetime from the database, if the return value is LifeTime{} then the session manager sets the life time based on the expiration duration lives in configuration.
func (*Database) Clear ¶ added in v10.6.0
Clear removes all session key values but it keeps the session entry.
func (*Database) Config ¶
Config returns the configuration for the redis server bridge, you can change them.
func (*Database) Delete ¶ added in v10.6.0
Delete removes a session key value based on its key.
func (*Database) Get ¶ added in v10.6.0
Get retrieves a session value based on the key.
func (*Database) Len ¶ added in v10.6.0
Len returns the length of the session's entries (keys).
func (*Database) Release ¶ added in v10.6.0
Release destroys the session, it clears and removes the session entry, session manager will create a new session ID on the next request after this call.