redis

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf Config) *redis.Client

New 返回redis client 需要自行保存

Types

type Config

type Config struct {
	Host        string `yaml:"host"`
	Port        string `yaml:"port"`
	Db          int    `yaml:"db"`
	Password    string `yaml:"password"`
	PoolSize    int    `yaml:"poolSize"`
	MinIdleConn int    `yaml:"MinIdleConn"`
}

type Control

type Control struct {
	Conn *redis.Client
}

func MakeControl

func MakeControl(client *redis.Client) *Control

MakeControl 通过redis client 创建控制器

func (*Control) ErrRedisDel

func (p *Control) ErrRedisDel(key string) bool

func (*Control) ErrRedisExists

func (p *Control) ErrRedisExists(key string) (bool, bool)

func (*Control) ErrRedisExpire

func (p *Control) ErrRedisExpire(key string, lifetime int) bool

func (*Control) ErrRedisGet

func (p *Control) ErrRedisGet(key string) (string, bool)

func (*Control) ErrRedisHDel

func (p *Control) ErrRedisHDel(key, field string) bool

func (*Control) ErrRedisHExists

func (p *Control) ErrRedisHExists(key, field string) (bool, bool)

func (*Control) ErrRedisHGet

func (p *Control) ErrRedisHGet(key, field string) (string, bool)

func (*Control) ErrRedisHScan

func (p *Control) ErrRedisHScan(key string, cursor uint64, match string, count int64) ([]string, uint64, bool)

func (*Control) ErrRedisHSet

func (p *Control) ErrRedisHSet(key, field, value string) bool

func (*Control) ErrRedisIncr

func (p *Control) ErrRedisIncr(key string) (int64, bool)

func (*Control) ErrRedisLRange

func (p *Control) ErrRedisLRange(key string, start, end int64) ([]string, bool)

func (*Control) ErrRedisPop

func (p *Control) ErrRedisPop(key string) (string, bool)

func (*Control) ErrRedisPush

func (p *Control) ErrRedisPush(key, value string) bool

func (*Control) ErrRedisSMembers

func (p *Control) ErrRedisSMembers(key string) ([]string, bool)

func (*Control) ErrRedisSadd

func (p *Control) ErrRedisSadd(key string, members ...interface{}) (int64, bool)

func (*Control) ErrRedisScan

func (p *Control) ErrRedisScan(cursor uint64, match string, count int64) ([]string, uint64, bool)

func (*Control) ErrRedisSet

func (p *Control) ErrRedisSet(key, value string, sec int) bool

func (*Control) ErrRedisZADD

func (p *Control) ErrRedisZADD(key string, members ...*redis.Z) (int64, bool)

set 类型 ***************************** 有序合集 set *****************************

func (*Control) ErrRedisZIncrBy

func (p *Control) ErrRedisZIncrBy(key string, increment float64, member string) (float64, bool)

func (*Control) ErrRedisZRange

func (p *Control) ErrRedisZRange(key string, start, stop int64) ([]string, bool)

***************************** ZRange *****************************

func (*Control) ErrRedisZRevRange

func (p *Control) ErrRedisZRevRange(key string, start, stop int64) ([]string, bool)

***************************** ZRevRange *****************************

func (*Control) ErrRedisZRevRangeWithScores

func (p *Control) ErrRedisZRevRangeWithScores(key string, start, stop int64) ([]redis.Z, bool)

***************************** ZRevRangeWithScores *****************************

func (*Control) RedisDel

func (p *Control) RedisDel(key string)

func (*Control) RedisExists

func (p *Control) RedisExists(key string) bool

func (*Control) RedisExpire

func (p *Control) RedisExpire(key string, lifetime int)

func (*Control) RedisGet

func (p *Control) RedisGet(key string) string

func (*Control) RedisHDel

func (p *Control) RedisHDel(key, field string)

func (*Control) RedisHExists

func (p *Control) RedisHExists(key, field string) bool

func (*Control) RedisHGet

func (p *Control) RedisHGet(key, field string) string

func (*Control) RedisHScan

func (p *Control) RedisHScan(key string, cursor uint64, match string, count int64) ([]string, uint64)

func (*Control) RedisHSet

func (p *Control) RedisHSet(key, field, value string)

func (*Control) RedisIncr

func (p *Control) RedisIncr(key string) int64

func (*Control) RedisLRange

func (p *Control) RedisLRange(key string, start, end int64) []string

func (*Control) RedisPop

func (p *Control) RedisPop(key string) string

func (*Control) RedisPush

func (p *Control) RedisPush(key, value string)

func (*Control) RedisSMembers

func (p *Control) RedisSMembers(key string) []string

func (*Control) RedisSadd

func (p *Control) RedisSadd(key string, members ...interface{}) int64

func (*Control) RedisScan

func (p *Control) RedisScan(cursor uint64, match string, count int64) ([]string, uint64)

func (*Control) RedisSet

func (p *Control) RedisSet(key, value string, sec int)

func (*Control) RedisZADD

func (p *Control) RedisZADD(key string, members ...*redis.Z) int64

func (*Control) RedisZIncrBy

func (p *Control) RedisZIncrBy(key string, increment float64, member string) float64

func (*Control) RedisZRange

func (p *Control) RedisZRange(key string, start, stop int64) []string

func (*Control) RedisZRevRange

func (p *Control) RedisZRevRange(key string, start, stop int64) []string

func (*Control) RedisZRevRangeWithScores

func (p *Control) RedisZRevRangeWithScores(key string, start, stop int64) []redis.Z

Jump to

Keyboard shortcuts

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