redis

package
v1.5.26 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AliyunRedisDB *redis.Client
View Source
var ImRedisDB *redis.Client

Functions

func BatchHashGet

func BatchHashGet(client *redis.Client, key string, fields ...string) map[string]interface{}

批量获取key的hash中对应多元素值

func BatchHashSet

func BatchHashSet(client *redis.Client, key string, fields map[string]interface{}, duration time.Duration) (string, error)

批量向key的hash添加对应元素field的值

func GetAliyunRedisClientPool

func GetAliyunRedisClientPool(db int) *redis.Client

func GetRedisClientPool

func GetRedisClientPool(db int) *redis.Client

func HashGet

func HashGet(client *redis.Client, key, field string) string

通过key获取hash的元素值

func HashGetAll

func HashGetAll(client *redis.Client, key string) (map[string]string, error)

func HashSet

func HashSet(client *redis.Client, key, field string, data interface{})

向key的hash中添加元素field的值

func Incr

func Incr(client *redis.Client, key string) int

获取自增唯一ID

func SetAdd

func SetAdd(client *redis.Client, key, val string)

添加集合数据

func SetGet

func SetGet(client *redis.Client, key string) []string

从集合中获取数据

func XAdd

func XAdd(client *redis.Client, stream string, MaxLen, MaxLenApprox int64, values map[string]interface{}) string

通过steamXAdd

Types

This section is empty.

Jump to

Keyboard shortcuts

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