Documentation ¶
Index ¶
- func Del(key string) error
- func GetJSON(key string, v interface{}) error
- func GetLock(key string, expired time.Duration) bool
- func GetRedis() (*redis.Client, error)
- func GetString(key string) (string, error)
- func InitCache(cli *redis.Client)
- func InitRedis(group, key string) error
- func InitRedisWithConfig(cfg *redis.Options) (*redis.Client, error)
- func IsExistKey(key string) (bool, time.Duration)
- func LPush(key string, values ...string) error
- func LRem(key string, count int64, value string) (int64, error)
- func Lock(key string, expired time.Duration) error
- func LockWithTimeout(key string, expired, interval, timeout time.Duration) bool
- func RPop(key string) (string, error)
- func RPopLPush(src, dst string) (string, error)
- func Redis() *redis.Client
- func SetJSON(key string, v interface{}, expired time.Duration) error
- func SetNX(key, data string, expired time.Duration) (bool, error)
- func SetString(key, value string, timeout time.Duration) error
- func Std() *redis.Client
- func UnLock(key string) error
- func ZAdd(key string, members ...redis.Z) (int64, error)
- func ZCount(key string, min, max string) (int64, error)
- func ZIncrBy(key string, increment float64, member string) (float64, error)
- func ZRange(key string, start, stop int64) ([]string, error)
- func ZRangeByScore(key string, by *redis.ZRangeBy) ([]string, error)
- func ZRangeByScoreWithScores(key string, by *redis.ZRangeBy) ([]redis.Z, error)
- func ZRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func ZRem(key string, member ...interface{}) (int64, error)
- type Cache
- func (c *Cache) Del(key string) error
- func (c *Cache) Get(key string) (string, error)
- func (c *Cache) HDel(key string, fields ...string) (int64, error)
- func (c *Cache) HExists(key string, field string) (bool, error)
- func (c *Cache) HGet(key string, field string) (string, error)
- func (c *Cache) HMSet(key string, values ...string) (int64, error)
- func (c *Cache) HSet(key string, field, value string) (int64, error)
- func (c *Cache) HSetNX(key string, field, value string) (bool, error)
- func (c *Cache) IsExist(key string) bool
- func (c *Cache) LPush(key string, values ...string) error
- func (c *Cache) LRem(key string, count int64, value string) (int64, error)
- func (c *Cache) RPop(key string) (string, error)
- func (c *Cache) RPopLPush(src, dst string) (string, error)
- func (c *Cache) SetEx(key, data string, expired time.Duration) error
- func (c *Cache) SetNX(key, data string, expired time.Duration) (bool, error)
- func (c *Cache) TTL(key string) time.Duration
- func (c *Cache) ZAdd(key string, members ...redis.Z) (int64, error)
- func (c *Cache) ZCount(key string, min, max string) (int64, error)
- func (c *Cache) ZIncrBy(key string, increment float64, member string) (float64, error)
- func (c *Cache) ZRange(key string, start, stop int64) ([]string, error)
- func (c *Cache) ZRangeByScore(key string, by *redis.ZRangeBy) ([]string, error)
- func (c *Cache) ZRangeByScoreWithScores(key string, by *redis.ZRangeBy) ([]redis.Z, error)
- func (c *Cache) ZRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func (c *Cache) ZRem(key string, member ...interface{}) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRedisWithConfig ¶
func InitRedisWithConfig(cfg *redis.Options) (*redis.Client, error)
InitRedisWithConfig 初始化redis连接
func LockWithTimeout ¶
LockWithTimeout 获取锁 key: 锁的key expired: 锁的超时时间 interval: 获取锁的间隔时间 timeout: 获取锁的超时时间
func ZRangeByScore ¶
func ZRangeByScoreWithScores ¶
func ZRangeWithScores ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func CacheInstance ¶
func CacheInstance() *Cache
func (*Cache) ZRangeByScore ¶
func (*Cache) ZRangeByScoreWithScores ¶
func (*Cache) ZRangeWithScores ¶
Click to show internal directories.
Click to hide internal directories.