cache

package
v0.0.0-...-13393c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 InitRedis

func InitRedis(cfg *config.Config) (*RedisClient, error)

func (*RedisClient) Del

func (c *RedisClient) Del(key string) error

func (*RedisClient) DelKeyByPrefix

func (c *RedisClient) DelKeyByPrefix(key string)

func (*RedisClient) Get

func (c *RedisClient) Get(key string) (string, error)

func (*RedisClient) GetKeysByPrefix

func (c *RedisClient) GetKeysByPrefix(key string) ([]string, error)

func (*RedisClient) GetList

func (c *RedisClient) GetList(key string) ([]string, error)

func (*RedisClient) HGetAll

func (c *RedisClient) HGetAll(key string) (map[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) SMembers

func (c *RedisClient) SMembers(key string) ([]string, error)

集合中元素列表

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL