Versions in this module Expand all Collapse all v12 v12.1.9 Aug 12, 2022 Changes in this version + const DefaultDelim + const DefaultRedisAddr + const DefaultRedisNetwork + const DefaultRedisTimeout + var ErrKeyNotFound = errors.New("key not found") + var ErrRedisClosed = errors.New("redis: already closed") + type Config struct + Addr string + Clusters []string + Database string + Delim string + Driver Driver + MaxActive int + Network string + Password string + Prefix string + Timeout time.Duration + func DefaultConfig() Config + type Database struct + func New(cfg ...Config) *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() *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) OnUpdateExpiration(sid string, newExpires time.Duration) error + 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{})) + type Driver interface + CloseConnection func() error + Connect func(c Config) error + Delete func(key string) error + Get func(key string) (interface{}, error) + GetAll func() (interface{}, error) + GetKeys func(prefix string) ([]string, error) + PingPong func() (bool, error) + Set func(key string, value interface{}, secondsLifetime int64) error + TTL func(key string) (seconds int64, hasExpiration bool, found bool) + UpdateTTL func(key string, newSecondsLifeTime int64) error + UpdateTTLMany func(prefix string, newSecondsLifeTime int64) error + type RadixDriver struct + Config Config + Connected bool + func Radix() *RadixDriver + func (r *RadixDriver) CloseConnection() error + func (r *RadixDriver) Connect(c Config) error + func (r *RadixDriver) Delete(key string) error + func (r *RadixDriver) Get(key string) (interface{}, error) + func (r *RadixDriver) GetAll() (interface{}, error) + func (r *RadixDriver) GetKeys(prefix string) ([]string, error) + func (r *RadixDriver) PingPong() (bool, error) + func (r *RadixDriver) Set(key string, value interface{}, secondsLifetime int64) error + func (r *RadixDriver) TTL(key string) (seconds int64, hasExpiration bool, found bool) + func (r *RadixDriver) UpdateTTL(key string, newSecondsLifeTime int64) error + func (r *RadixDriver) UpdateTTLMany(prefix string, newSecondsLifeTime int64) error + type RedigoDriver struct + Config Config + Connected bool + IdleTimeout time.Duration + MaxIdle int + Wait bool + func Redigo() *RedigoDriver + func (r *RedigoDriver) CloseConnection() error + func (r *RedigoDriver) Connect(c Config) error + func (r *RedigoDriver) Delete(key string) error + func (r *RedigoDriver) Get(key string) (interface{}, error) + func (r *RedigoDriver) GetAll() (interface{}, error) + func (r *RedigoDriver) GetBytes(key string) ([]byte, error) + func (r *RedigoDriver) GetKeys(prefix string) ([]string, error) + func (r *RedigoDriver) PingPong() (bool, error) + func (r *RedigoDriver) Set(key string, value interface{}, secondsLifetime int64) (err error) + func (r *RedigoDriver) TTL(key string) (seconds int64, hasExpiration bool, found bool) + func (r *RedigoDriver) UpdateTTL(key string, newSecondsLifeTime int64) error + func (r *RedigoDriver) UpdateTTLMany(prefix string, newSecondsLifeTime int64) error