redis

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) redis.UniversalClient

func InitRedises

func InitRedises()

func ListPop added in v1.0.17

func ListPop(rds redis.UniversalClient, keys []string, timeout, goPoolSize int, handler func(key, data string))

list结构主要用来做异步操作,相当于一对一发送接收

func ListPush added in v1.0.17

func ListPush(ctx context.Context, rds redis.UniversalClient, key string, data ...interface{}) error

func MqPSubscribe added in v1.0.17

func MqPSubscribe(c context.Context, rds redis.UniversalClient, pChannel string, handler func(channel string, data string),
	goPoolSize int)

func MqPublish added in v1.0.17

func MqPublish(ctx context.Context, rds redis.UniversalClient, channel string, message interface{}) error

func RdsAllowActionByMTs added in v1.0.17

func RdsAllowActionByMTs(ctx context.Context, rds redis.UniversalClient, actionKey string, cdMillSeconds, keyTTL int) (int64, bool)

func RdsAllowActionWithCD added in v1.0.17

func RdsAllowActionWithCD(ctx context.Context, rds redis.UniversalClient, actionKey string, cdSeconds int) (int, bool)

func RdsLockResWithCD added in v1.0.17

func RdsLockResWithCD(ctx context.Context, rds redis.UniversalClient, resKey, resValue string, cdSeconds int) bool

RdsLockResWithCD(ctx context.Context, rds redis.UniversalClient, resKeyName, config.ServerId, runtimeSeconds*2)

func ZBatchAdd added in v1.0.16

func ZBatchAdd(ctx context.Context, rds redis.UniversalClient, keyName string, members []*redis.Z, ttl, batchSize int) error

func ZDescartes added in v1.0.16

func ZDescartes(ctx context.Context, rds redis.UniversalClient, dimValues [][]string, filter ZDescartesFilter,
	ttl, batchSize int) error

Types

type ZDescartesFilter added in v1.0.16

type ZDescartesFilter func([]string) (string, map[string]int64)

Jump to

Keyboard shortcuts

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