Documentation ¶
Index ¶
- func NewRedisProvider(app *foundation.Application) foundation.Provider
- type Connection
- type Manager
- type RedisClusterConnection
- func (c *RedisClusterConnection) Append(key, value string) (int64, error)
- func (c *RedisClusterConnection) Connect(config map[string]interface{})
- func (c *RedisClusterConnection) DBSize() (int64, error)
- func (c *RedisClusterConnection) Decr(key string) (int64, error)
- func (c *RedisClusterConnection) DecrBy(key string, decrement int64) (int64, error)
- func (c *RedisClusterConnection) Del(keys ...string) (int64, error)
- func (c *RedisClusterConnection) Echo(message string) (string, error)
- func (c *RedisClusterConnection) Exists(keys ...string) (int64, error)
- func (c *RedisClusterConnection) Expire(key string, expiration time.Duration) (bool, error)
- func (c *RedisClusterConnection) ExpireAt(key string, tm time.Time) (bool, error)
- func (c *RedisClusterConnection) ExpireGT(key string, expiration time.Duration) (bool, error)
- func (c *RedisClusterConnection) ExpireLT(key string, expiration time.Duration) (bool, error)
- func (c *RedisClusterConnection) ExpireNX(key string, expiration time.Duration) (bool, error)
- func (c *RedisClusterConnection) ExpireXX(key string, expiration time.Duration) (bool, error)
- func (c *RedisClusterConnection) Get(key string) (string, error)
- func (c *RedisClusterConnection) GetDel(key string) (string, error)
- func (c *RedisClusterConnection) GetEx(key string, expiration time.Duration) (string, error)
- func (c *RedisClusterConnection) GetRange(key string, start, end int64) (string, error)
- func (c *RedisClusterConnection) GetSet(key string, value interface{}) (string, error)
- func (c *RedisClusterConnection) Incr(key string) (int64, error)
- func (c *RedisClusterConnection) IncrBy(key string, value int64) (int64, error)
- func (c *RedisClusterConnection) IncrByFloat(key string, value float64) (float64, error)
- func (c *RedisClusterConnection) Keys(pattern string) ([]string, error)
- func (c *RedisClusterConnection) MGet(keys ...string) ([]interface{}, error)
- func (c *RedisClusterConnection) MSet(values ...interface{}) (string, error)
- func (c *RedisClusterConnection) MSetNX(values ...interface{}) (bool, error)
- func (c *RedisClusterConnection) Migrate(host, port, key string, db int, timeout time.Duration) (string, error)
- func (c *RedisClusterConnection) Move(key string, db int) (bool, error)
- func (c *RedisClusterConnection) PExpire(key string, expiration time.Duration) (bool, error)
- func (c *RedisClusterConnection) PExpireAt(key string, tm time.Time) (bool, error)
- func (c *RedisClusterConnection) PTTL(key string) (time.Duration, error)
- func (c *RedisClusterConnection) Persist(key string) (bool, error)
- func (c *RedisClusterConnection) Ping() (string, error)
- func (c *RedisClusterConnection) RandomKey() (string, error)
- func (c *RedisClusterConnection) Rename(key, newKey string) (string, error)
- func (c *RedisClusterConnection) RenameNX(key, newKey string) (bool, error)
- func (c *RedisClusterConnection) Restore(key string, ttl time.Duration, value string) (string, error)
- func (c *RedisClusterConnection) RestoreReplace(key string, ttl time.Duration, value string) (string, error)
- func (c *RedisClusterConnection) Set(key string, value interface{}, expiration time.Duration) (string, error)
- func (c *RedisClusterConnection) Sort(key string, sort *r.Sort) ([]string, error)
- func (c *RedisClusterConnection) SortInterfaces(key string, sort *r.Sort) ([]interface{}, error)
- func (c *RedisClusterConnection) SortStore(key, store string, sort *r.Sort) (int64, error)
- func (c *RedisClusterConnection) TTL(key string) (time.Duration, error)
- func (c *RedisClusterConnection) Touch(keys ...string) (int64, error)
- func (c *RedisClusterConnection) Type(key string) (string, error)
- type RedisConnection
- func (c *RedisConnection) Append(key, value string) (int64, error)
- func (c *RedisConnection) Connect(config map[string]interface{})
- func (c *RedisConnection) DBSize() (int64, error)
- func (c *RedisConnection) Decr(key string) (int64, error)
- func (c *RedisConnection) DecrBy(key string, decrement int64) (int64, error)
- func (c *RedisConnection) Del(keys ...string) (int64, error)
- func (c *RedisConnection) Echo(message string) (string, error)
- func (c *RedisConnection) Exists(keys ...string) (int64, error)
- func (c *RedisConnection) Expire(key string, expiration time.Duration) (bool, error)
- func (c *RedisConnection) ExpireAt(key string, tm time.Time) (bool, error)
- func (c *RedisConnection) ExpireGT(key string, expiration time.Duration) (bool, error)
- func (c *RedisConnection) ExpireLT(key string, expiration time.Duration) (bool, error)
- func (c *RedisConnection) ExpireNX(key string, expiration time.Duration) (bool, error)
- func (c *RedisConnection) ExpireXX(key string, expiration time.Duration) (bool, error)
- func (c *RedisConnection) Get(key string) (string, error)
- func (c *RedisConnection) GetDel(key string) (string, error)
- func (c *RedisConnection) GetEx(key string, expiration time.Duration) (string, error)
- func (c *RedisConnection) GetRange(key string, start, end int64) (string, error)
- func (c *RedisConnection) GetSet(key string, value interface{}) (string, error)
- func (c *RedisConnection) Incr(key string) (int64, error)
- func (c *RedisConnection) IncrBy(key string, value int64) (int64, error)
- func (c *RedisConnection) IncrByFloat(key string, value float64) (float64, error)
- func (c *RedisConnection) Keys(pattern string) ([]string, error)
- func (c *RedisConnection) MGet(keys ...string) ([]interface{}, error)
- func (c *RedisConnection) MSet(values ...interface{}) (string, error)
- func (c *RedisConnection) MSetNX(values ...interface{}) (bool, error)
- func (c *RedisConnection) Migrate(host, port, key string, db int, timeout time.Duration) (string, error)
- func (c *RedisConnection) Move(key string, db int) (bool, error)
- func (c *RedisConnection) PExpire(key string, expiration time.Duration) (bool, error)
- func (c *RedisConnection) PExpireAt(key string, tm time.Time) (bool, error)
- func (c *RedisConnection) PTTL(key string) (time.Duration, error)
- func (c *RedisConnection) Persist(key string) (bool, error)
- func (c *RedisConnection) Ping() (string, error)
- func (c *RedisConnection) RandomKey() (string, error)
- func (c *RedisConnection) Rename(key, newKey string) (string, error)
- func (c *RedisConnection) RenameNX(key, newKey string) (bool, error)
- func (c *RedisConnection) Restore(key string, ttl time.Duration, value string) (string, error)
- func (c *RedisConnection) RestoreReplace(key string, ttl time.Duration, value string) (string, error)
- func (c *RedisConnection) Set(key string, value interface{}, expiration time.Duration) (string, error)
- func (c *RedisConnection) Sort(key string, sort *r.Sort) ([]string, error)
- func (c *RedisConnection) SortInterfaces(key string, sort *r.Sort) ([]interface{}, error)
- func (c *RedisConnection) SortStore(key, store string, sort *r.Sort) (int64, error)
- func (c *RedisConnection) TTL(key string) (time.Duration, error)
- func (c *RedisConnection) Touch(keys ...string) (int64, error)
- func (c *RedisConnection) Type(key string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisProvider ¶
func NewRedisProvider(app *foundation.Application) foundation.Provider
Types ¶
type Connection ¶
type Connection interface { Connect(map[string]interface{}) Set(string, interface{}, time.Duration) (string, error) Get(string) (string, error) Echo(string) (string, error) Ping() (string, error) Del(...string) (int64, error) Exists(...string) (int64, error) }
func NewRedisClusterConnection ¶
func NewRedisClusterConnection() Connection
NewRedisClusterConnection creates a new redis connection.
func NewRedisConnection ¶
func NewRedisConnection() Connection
NewRedisConnection creates a new redis connection.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(app *foundation.Application) *Manager
func (*Manager) Connection ¶
func (m *Manager) Connection(name ...string) Connection
type RedisClusterConnection ¶
type RedisClusterConnection struct {
// contains filtered or unexported fields
}
RedisClusterConnection is a connection to a redis database.
func (*RedisClusterConnection) Append ¶
func (c *RedisClusterConnection) Append(key, value string) (int64, error)
func (*RedisClusterConnection) Connect ¶
func (c *RedisClusterConnection) Connect(config map[string]interface{})
Connect connects to the redis database.
func (*RedisClusterConnection) DBSize ¶
func (c *RedisClusterConnection) DBSize() (int64, error)
func (*RedisClusterConnection) Decr ¶
func (c *RedisClusterConnection) Decr(key string) (int64, error)
func (*RedisClusterConnection) DecrBy ¶
func (c *RedisClusterConnection) DecrBy(key string, decrement int64) (int64, error)
func (*RedisClusterConnection) Del ¶
func (c *RedisClusterConnection) Del(keys ...string) (int64, error)
Del deletes the given keys.
c.Del("key1", "key2") c.Del("key3")
func (*RedisClusterConnection) Echo ¶
func (c *RedisClusterConnection) Echo(message string) (string, error)
Echo returns the given string.
func (*RedisClusterConnection) Exists ¶
func (c *RedisClusterConnection) Exists(keys ...string) (int64, error)
func (*RedisClusterConnection) Get ¶
func (c *RedisClusterConnection) Get(key string) (string, error)
func (*RedisClusterConnection) GetDel ¶
func (c *RedisClusterConnection) GetDel(key string) (string, error)
func (*RedisClusterConnection) GetRange ¶
func (c *RedisClusterConnection) GetRange(key string, start, end int64) (string, error)
func (*RedisClusterConnection) GetSet ¶
func (c *RedisClusterConnection) GetSet(key string, value interface{}) (string, error)
func (*RedisClusterConnection) Incr ¶
func (c *RedisClusterConnection) Incr(key string) (int64, error)
func (*RedisClusterConnection) IncrBy ¶
func (c *RedisClusterConnection) IncrBy(key string, value int64) (int64, error)
func (*RedisClusterConnection) IncrByFloat ¶
func (c *RedisClusterConnection) IncrByFloat(key string, value float64) (float64, error)
func (*RedisClusterConnection) Keys ¶
func (c *RedisClusterConnection) Keys(pattern string) ([]string, error)
func (*RedisClusterConnection) MGet ¶
func (c *RedisClusterConnection) MGet(keys ...string) ([]interface{}, error)
func (*RedisClusterConnection) MSet ¶
func (c *RedisClusterConnection) MSet(values ...interface{}) (string, error)
func (*RedisClusterConnection) MSetNX ¶
func (c *RedisClusterConnection) MSetNX(values ...interface{}) (bool, error)
func (*RedisClusterConnection) Move ¶
func (c *RedisClusterConnection) Move(key string, db int) (bool, error)
func (*RedisClusterConnection) PTTL ¶
func (c *RedisClusterConnection) PTTL(key string) (time.Duration, error)
func (*RedisClusterConnection) Persist ¶
func (c *RedisClusterConnection) Persist(key string) (bool, error)
func (*RedisClusterConnection) Ping ¶
func (c *RedisClusterConnection) Ping() (string, error)
Ping returns the redis ping.
func (*RedisClusterConnection) RandomKey ¶
func (c *RedisClusterConnection) RandomKey() (string, error)
func (*RedisClusterConnection) Rename ¶
func (c *RedisClusterConnection) Rename(key, newKey string) (string, error)
func (*RedisClusterConnection) RenameNX ¶
func (c *RedisClusterConnection) RenameNX(key, newKey string) (bool, error)
func (*RedisClusterConnection) RestoreReplace ¶
func (*RedisClusterConnection) SortInterfaces ¶
func (c *RedisClusterConnection) SortInterfaces(key string, sort *r.Sort) ([]interface{}, error)
func (*RedisClusterConnection) TTL ¶
func (c *RedisClusterConnection) TTL(key string) (time.Duration, error)
type RedisConnection ¶
type RedisConnection struct {
// contains filtered or unexported fields
}
RedisConnection is a connection to a redis database.
func (*RedisConnection) Connect ¶
func (c *RedisConnection) Connect(config map[string]interface{})
Connect connects to the redis database.
func (*RedisConnection) DBSize ¶
func (c *RedisConnection) DBSize() (int64, error)
func (*RedisConnection) DecrBy ¶
func (c *RedisConnection) DecrBy(key string, decrement int64) (int64, error)
func (*RedisConnection) Del ¶
func (c *RedisConnection) Del(keys ...string) (int64, error)
Del deletes the given keys.
c.Del("key1", "key2") c.Del("key3")
func (*RedisConnection) Echo ¶
func (c *RedisConnection) Echo(message string) (string, error)
Echo returns the given string.
func (*RedisConnection) GetRange ¶
func (c *RedisConnection) GetRange(key string, start, end int64) (string, error)
func (*RedisConnection) GetSet ¶
func (c *RedisConnection) GetSet(key string, value interface{}) (string, error)
func (*RedisConnection) IncrBy ¶
func (c *RedisConnection) IncrBy(key string, value int64) (int64, error)
func (*RedisConnection) IncrByFloat ¶
func (c *RedisConnection) IncrByFloat(key string, value float64) (float64, error)
func (*RedisConnection) MGet ¶
func (c *RedisConnection) MGet(keys ...string) ([]interface{}, error)
func (*RedisConnection) MSet ¶
func (c *RedisConnection) MSet(values ...interface{}) (string, error)
func (*RedisConnection) MSetNX ¶
func (c *RedisConnection) MSetNX(values ...interface{}) (bool, error)
func (*RedisConnection) Ping ¶
func (c *RedisConnection) Ping() (string, error)
Ping returns the redis ping.
func (*RedisConnection) RandomKey ¶
func (c *RedisConnection) RandomKey() (string, error)
func (*RedisConnection) Rename ¶
func (c *RedisConnection) Rename(key, newKey string) (string, error)
func (*RedisConnection) RenameNX ¶
func (c *RedisConnection) RenameNX(key, newKey string) (bool, error)
func (*RedisConnection) RestoreReplace ¶
func (*RedisConnection) SortInterfaces ¶
func (c *RedisConnection) SortInterfaces(key string, sort *r.Sort) ([]interface{}, error)
Click to show internal directories.
Click to hide internal directories.