Documentation
¶
Index ¶
- func Decr(ctx context.Context, key string) int64
- func DecrBy(ctx context.Context, key string, incr int64) int64
- func Del(ctx context.Context, key string) bool
- func Expire(ctx context.Context, key string, ex time.Duration) bool
- func Get(ctx context.Context, key string) (bool, string)
- func GetSet(ctx context.Context, key string, value interface{}) (bool, string)
- func HDel(ctx context.Context, key string, fields ...string) bool
- func HExists(ctx context.Context, key, field string) bool
- func HGet(ctx context.Context, key, field string) string
- func HGetAll(ctx context.Context, key string) map[string]string
- func HKeys(ctx context.Context, key string) []string
- func HLen(ctx context.Context, key string) int64
- func HMGet(ctx context.Context, key string, fields ...string) []interface{}
- func HMSet(ctx context.Context, key string, value map[string]interface{}) bool
- func HSet(ctx context.Context, key, field, value string) bool
- func HSetNX(ctx context.Context, key, field string, value interface{}) bool
- func Incr(ctx context.Context, key string) int64
- func IncrBy(ctx context.Context, key string, incr int64) int64
- func IncrByFloat(ctx context.Context, key string, incrFloat float64) float64
- func LIndex(ctx context.Context, key string, index int64) (bool, string)
- func LInsert(ctx context.Context, key string, pivot int64, value interface{}) bool
- func LLen(ctx context.Context, key string) int64
- func LPop(ctx context.Context, key string) (bool, string)
- func LPush(ctx context.Context, key string, values ...interface{}) int64
- func LRange(ctx context.Context, key string, start, stop int64) []string
- func LRem(ctx context.Context, key string, count int64, value interface{}) bool
- func Lock(ctx context.Context, key, value string) (bool, error)
- func LockCtx(ctx context.Context, key, value string, seconds int) (bool, error)
- func NewRedisSentinelAuto() *redis.Client
- func RPop(ctx context.Context, key string) (bool, string)
- func RPush(ctx context.Context, key string, values ...interface{}) int64
- func SAdd(ctx context.Context, key string, values ...interface{}) bool
- func SCard(ctx context.Context, key string) int64
- func SIsMember(ctx context.Context, key string, value interface{}) bool
- func SMembers(ctx context.Context, key string) []string
- func SPopN(ctx context.Context, key string, count int64) []string
- func SRem(ctx context.Context, key string, values ...interface{}) bool
- func Set(ctx context.Context, key string, value interface{}) bool
- func SetEX(ctx context.Context, key string, value interface{}, ex time.Duration) bool
- func UnLockCtx(ctx context.Context, key, value string) (bool, error)
- type Redis
- type RedisConf
- type RedisLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncrByFloat ¶
IncrByFloat key值每次加指定浮点型数值 并返回新值
func NewRedisSentinelAuto ¶
Types ¶
type Redis ¶
func InitRedisConf ¶
type RedisConf ¶
type RedisConf struct {
Addrs []string `json:",default=127.0.0.1:6379"`
//Port int `json:",default=6379"`
Pass string `json:",optional"`
Username string `json:",optional"`
DB int `json:",default=0,range=[0:15]"`
Type string `json:",default=standalone,options=standalone|sentinel|cluster"`
MasterName string `json:",optional"`
PoolSize int `json:",default=0"`
MinIdleConns int `json:",default=10"`
MaxRetries int `json:",default=1,range=[0:3]"`
}
type RedisLock ¶
type RedisLock struct {
// contains filtered or unexported fields
}
A RedisLock is a redis lock.
func NewAutoRedisLock ¶
func NewRedisLock ¶
NewRedisLock returns a RedisLock.
Click to show internal directories.
Click to hide internal directories.