Documentation ¶
Index ¶
- type RedisClient
- func (c *RedisClient) Del(key string) error
- func (c *RedisClient) DelKeyByPrefix(key string)
- func (c *RedisClient) Get(key string) (string, error)
- func (c *RedisClient) GetKeysByPrefix(key string) ([]string, error)
- func (c *RedisClient) GetList(key string) ([]string, error)
- func (c *RedisClient) HGetAll(key string) (map[string]string, error)
- func (c *RedisClient) HMGet(key string, fields ...string) ([]interface{}, error)
- func (c *RedisClient) HMSet(key string, values ...interface{}) (bool, error)
- func (c *RedisClient) IsExist(key string) bool
- func (c *RedisClient) IsNotExist(key string) bool
- func (c *RedisClient) PopList(key string) []string
- func (c *RedisClient) RPush(key, value string) error
- func (c *RedisClient) SAdd(key string, members ...interface{}) (int64, error)
- func (c *RedisClient) SIsMember(key string, member interface{}) bool
- func (c *RedisClient) SMembers(key string) ([]string, error)
- func (c *RedisClient) SRem(key string, members ...interface{}) (int64, error)
- func (c *RedisClient) Set(key string, value interface{}, expiration time.Duration) error
- func (c *RedisClient) SetKeyWithExpireAt(key, value string, expireAt time.Time) error
- func (c *RedisClient) Verify(key, value string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient struct {
*redis.Client
}
func GetRedisInstance ¶
func GetRedisInstance() *RedisClient
func (*RedisClient) Del ¶
func (c *RedisClient) Del(key string) error
func (*RedisClient) DelKeyByPrefix ¶
func (c *RedisClient) DelKeyByPrefix(key string)
func (*RedisClient) GetKeysByPrefix ¶
func (c *RedisClient) GetKeysByPrefix(key string) ([]string, error)
func (*RedisClient) HMGet ¶
func (c *RedisClient) HMGet(key string, fields ...string) ([]interface{}, error)
获取hashmap的数据
func (*RedisClient) HMSet ¶
func (c *RedisClient) HMSet(key string, values ...interface{}) (bool, error)
func (*RedisClient) IsExist ¶
func (c *RedisClient) IsExist(key string) bool
func (*RedisClient) IsNotExist ¶
func (c *RedisClient) IsNotExist(key string) bool
func (*RedisClient) PopList ¶
func (c *RedisClient) PopList(key string) []string
func (*RedisClient) RPush ¶
func (c *RedisClient) RPush(key, value string) error
func (*RedisClient) SAdd ¶
func (c *RedisClient) SAdd(key string, members ...interface{}) (int64, error)
向集合添加元素
func (*RedisClient) SIsMember ¶
func (c *RedisClient) SIsMember(key string, member interface{}) bool
指定元素是否在集合中
func (*RedisClient) SRem ¶
func (c *RedisClient) SRem(key string, members ...interface{}) (int64, error)
从集合中删除
func (*RedisClient) Set ¶
func (c *RedisClient) Set(key string, value interface{}, expiration time.Duration) error
func (*RedisClient) SetKeyWithExpireAt ¶
func (c *RedisClient) SetKeyWithExpireAt(key, value string, expireAt time.Time) error
func (*RedisClient) Verify ¶
func (c *RedisClient) Verify(key, value string) bool
Click to show internal directories.
Click to hide internal directories.