zredis

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPIN_TIME = 10
	SPIN_NUM  = 10
)

Variables

This section is empty.

Functions

func NewRedisClient

func NewRedisClient(opt *redis.Options) *redis.Client

func ReleaseJobMux

func ReleaseJobMux(r *RedisClient, key string)

func SetJobMux

func SetJobMux(r *RedisClient, key, val string, expireTime time.Duration) bool

func SetJobMuxWithSpins

func SetJobMuxWithSpins(r *RedisClient, key, val string, expireTime, spinTime time.Duration, spinNum int) bool

Types

type RedisClient

type RedisClient struct {
	*redis.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opt *redis.Options, clientName string) *RedisClient

func NewClientWithProm

func NewClientWithProm(opt *redis.Options, clientName string) *RedisClient

func (RedisClient) Del

func (c RedisClient) Del(keys ...string) (cmd *redis.IntCmd)

func (RedisClient) Expire

func (c RedisClient) Expire(key string, expiration time.Duration) (cmd *redis.BoolCmd)

func (RedisClient) ExpireAt

func (c RedisClient) ExpireAt(key string, tm time.Time) (cmd *redis.BoolCmd)

func (RedisClient) Get

func (c RedisClient) Get(key string) (cmd *redis.StringCmd)

func (RedisClient) GetPoolConnections

func (c RedisClient) GetPoolConnections() uint32

func (RedisClient) HDel

func (c RedisClient) HDel(key string, fields ...string) (cmd *redis.IntCmd)

func (RedisClient) HExists

func (c RedisClient) HExists(key, field string) (cmd *redis.BoolCmd)

func (RedisClient) HGet

func (c RedisClient) HGet(key, field string) (cmd *redis.StringCmd)

func (RedisClient) HGetAll

func (c RedisClient) HGetAll(key string) (cmd *redis.StringStringMapCmd)

func (RedisClient) HIncrBy

func (c RedisClient) HIncrBy(key, field string, incr int64) (cmd *redis.IntCmd)

func (RedisClient) HMGet

func (c RedisClient) HMGet(key string, fields ...string) (cmd *redis.SliceCmd)

func (RedisClient) HMSet

func (c RedisClient) HMSet(key string, fields map[string]interface{}) (cmd *redis.StatusCmd)

func (RedisClient) HScan

func (c RedisClient) HScan(key string, cursor uint64, match string, count int64) (cmd *redis.ScanCmd)

func (RedisClient) HSet

func (c RedisClient) HSet(key, field string, value interface{}) (cmd *redis.BoolCmd)

func (RedisClient) HSetNX

func (c RedisClient) HSetNX(key, field string, value interface{}) (cmd *redis.BoolCmd)

func (RedisClient) Incr

func (c RedisClient) Incr(key string) (cmd *redis.IntCmd)

func (RedisClient) Keys

func (c RedisClient) Keys(pattern string) (cmd *redis.StringSliceCmd)

func (RedisClient) LIndex

func (c RedisClient) LIndex(key string, index int64) (cmd *redis.StringCmd)

func (RedisClient) LLen

func (c RedisClient) LLen(key string) (cmd *redis.IntCmd)

func (RedisClient) LPop

func (c RedisClient) LPop(key string) (cmd *redis.StringCmd)

func (RedisClient) LPush

func (c RedisClient) LPush(key string, values ...interface{}) (cmd *redis.IntCmd)

func (RedisClient) LRem

func (c RedisClient) LRem(key string, count int64, value interface{}) (cmd *redis.IntCmd)

func (RedisClient) Pipeline

func (c RedisClient) Pipeline() RedisPipeliner

func (RedisClient) Publish

func (c RedisClient) Publish(channel string, message interface{}) (cmd *redis.IntCmd)

func (RedisClient) RPop

func (c RedisClient) RPop(key string) (cmd *redis.StringCmd)

func (RedisClient) RPush

func (c RedisClient) RPush(key string, values ...interface{}) (cmd *redis.IntCmd)

func (RedisClient) Rename

func (c RedisClient) Rename(key, newkey string) (cmd *redis.StatusCmd)

func (RedisClient) SAdd

func (c RedisClient) SAdd(key string, members ...interface{}) (cmd *redis.IntCmd)

func (RedisClient) SCard

func (c RedisClient) SCard(key string) (cmd *redis.IntCmd)

func (RedisClient) SIsMember

func (c RedisClient) SIsMember(key string, member interface{}) (cmd *redis.BoolCmd)

func (RedisClient) SMembers

func (c RedisClient) SMembers(key string) (cmd *redis.StringSliceCmd)

func (RedisClient) SRem

func (c RedisClient) SRem(key string, members ...interface{}) (cmd *redis.IntCmd)

func (RedisClient) Scan

func (c RedisClient) Scan(cursor uint64, match string, count int64) (cmd *redis.ScanCmd)

func (RedisClient) Set

func (c RedisClient) Set(key string, value interface{}, expiration time.Duration) (cmd *redis.StatusCmd)

func (RedisClient) SetNX

func (c RedisClient) SetNX(key string, value interface{}, expiration time.Duration) (cmd *redis.BoolCmd)

func (RedisClient) Subscribe

func (c RedisClient) Subscribe(channels ...string) (cmd *redis.PubSub)
func (c RedisClient) Unlink(key ...string) (cmd *redis.IntCmd)

?

func (RedisClient) ZAdd

func (c RedisClient) ZAdd(key string, members ...redis.Z) (cmd *redis.IntCmd)

func (RedisClient) ZAddNX

func (c RedisClient) ZAddNX(key string, members ...redis.Z) (cmd *redis.IntCmd)

func (RedisClient) ZAddXX

func (c RedisClient) ZAddXX(key string, members ...redis.Z) (cmd *redis.IntCmd)

func (RedisClient) ZCard

func (c RedisClient) ZCard(key string) (cmd *redis.IntCmd)

func (RedisClient) ZCount

func (c RedisClient) ZCount(key, min, max string) (cmd *redis.IntCmd)

func (RedisClient) ZIncr

func (c RedisClient) ZIncr(key string, member redis.Z) (cmd *redis.FloatCmd)

?

func (RedisClient) ZIncrBy

func (c RedisClient) ZIncrBy(key string, increment float64, member string) (cmd *redis.FloatCmd)

func (RedisClient) ZRangeWithScoresX

func (c RedisClient) ZRangeWithScoresX(key string, start, stop int64, rev bool) (cmd *redis.ZSliceCmd)

ZRangeWithScoresX 返回正序 or 倒序的名次范围的zSet

func (RedisClient) ZRangeX

func (c RedisClient) ZRangeX(key string, start, stop int64, rev bool) (cmd *redis.StringSliceCmd)

ZRangeX 返回正序 or 倒序的名次范围的zSet.Member

func (RedisClient) ZRankX

func (c RedisClient) ZRankX(key, member string, rev bool) (cmd *redis.IntCmd)

ZRankX 返回正序 or 倒序

func (RedisClient) ZRem

func (c RedisClient) ZRem(key string, members ...interface{}) (cmd *redis.IntCmd)

func (RedisClient) ZRemRangeByRank

func (c RedisClient) ZRemRangeByRank(key string, start, stop int64) (cmd *redis.IntCmd)

ZRemRangeByRank 根据倒序排名移出

func (RedisClient) ZScore

func (c RedisClient) ZScore(key, member string) (cmd *redis.FloatCmd)

type RedisPipeliner

type RedisPipeliner struct {
	redis.Pipeliner
}

func (RedisPipeliner) Exec

func (pipe RedisPipeliner) Exec() (cmd []redis.Cmder, err error)

Jump to

Keyboard shortcuts

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