Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { // 字符串 Set(key string, value interface{}, expiration time.Duration) error Get(key string) (string, error) Incr(key string) (int64, error) Decr(key string) (int64, error) Del(key string) error Exists(key string) (bool, error) Expire(key string, expiration time.Duration) error // 哈希 HSet(key string, values ...interface{}) error HGet(key, field string) (string, error) HGetAll(key string) (map[string]string, error) HDel(key string, fields ...string) error // 列表 LPush(key string, values ...interface{}) error RPop(key string) (string, error) // 集合 SAdd(key string, members ...interface{}) error SMembers(key string) ([]string, error) SRem(key string, members ...interface{}) error // 分布式锁 TryLock(key, value string, expiration time.Duration) (bool, error) Unlock(key string) error // Lua 脚本 Eval(script string, keys []string, args ...interface{}) (interface{}, error) }
Store 定义对 Redis 的常用操作接口
Click to show internal directories.
Click to hide internal directories.