redis

package
v0.0.0-...-532f4bb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoRedis

type GoRedis struct {
	// contains filtered or unexported fields
}

func InitRedis

func InitRedis(conf *RedisConfig) (*GoRedis, error)

func (*GoRedis) BitCount

func (cli *GoRedis) BitCount(key string, start, end int64) (int64, error)

func (*GoRedis) Decr

func (cli *GoRedis) Decr(key string) (int64, error)

func (*GoRedis) DecrBy

func (cli *GoRedis) DecrBy(key string, value int64) (int64, error)

func (*GoRedis) Del

func (cli *GoRedis) Del(keys []string) error

func (*GoRedis) Eval

func (cli *GoRedis) Eval(script string, keys []string, args []interface{}) (interface{}, error)

func (*GoRedis) EvalSha

func (cli *GoRedis) EvalSha(script string, keys []string, args []interface{}) (interface{}, error)

func (*GoRedis) Exists

func (cli *GoRedis) Exists(keys []string) (int64, error)

//////////////////////////////////////////////////////// key ////////////////////////////////////////////////////////

func (*GoRedis) Expire

func (cli *GoRedis) Expire(key string, expiration int) (bool, error)

func (*GoRedis) Get

func (cli *GoRedis) Get(key string) (string, error)

func (*GoRedis) GetBit

func (cli *GoRedis) GetBit(key string, offset int64) (int64, error)

func (*GoRedis) HDel

func (cli *GoRedis) HDel(key string, fields []string) error

func (*GoRedis) HExists

func (cli *GoRedis) HExists(key, field string) (bool, error)

func (*GoRedis) HGet

func (cli *GoRedis) HGet(key, field string) (string, error)

func (*GoRedis) HGetAll

func (cli *GoRedis) HGetAll(key string) (map[string]string, error)

func (*GoRedis) HIncrBy

func (cli *GoRedis) HIncrBy(key, field string, incr int64) (int64, error)

func (*GoRedis) HKeys

func (cli *GoRedis) HKeys(key string) ([]string, error)

func (*GoRedis) HMGet

func (cli *GoRedis) HMGet(key string, fields []string) ([]interface{}, error)

func (*GoRedis) HMSet

func (cli *GoRedis) HMSet(key string, fields map[string]interface{}) error

func (*GoRedis) HSet

func (cli *GoRedis) HSet(key, field string, value interface{}) error

////////////////////////////////////// hash //////////////////////////////////////

func (*GoRedis) HSetNX

func (cli *GoRedis) HSetNX(key, field string, value interface{}) error

func (*GoRedis) HVals

func (cli *GoRedis) HVals(key string) ([]string, error)

func (*GoRedis) Incr

func (cli *GoRedis) Incr(key string) (int64, error)

////////////////////////////////////// string //////////////////////////////////////

func (*GoRedis) IncrBy

func (cli *GoRedis) IncrBy(key string, value int64) (int64, error)

func (*GoRedis) MGet

func (cli *GoRedis) MGet(keys []string) (map[string]interface{}, error)

func (*GoRedis) MSet

func (cli *GoRedis) MSet(keyValues map[string]interface{}) error

func (*GoRedis) MSetNx

func (cli *GoRedis) MSetNx(keyValues map[string]interface{}) error

func (*GoRedis) Persist

func (cli *GoRedis) Persist(key string) (bool, error)

func (*GoRedis) Ping

func (cli *GoRedis) Ping() bool

func (*GoRedis) Pipeline

func (cli *GoRedis) Pipeline() redis.Pipeliner

////////////////////////////////////// 其他高级属性 //////////////////////////////////////

func (*GoRedis) Pipelined

func (cli *GoRedis) Pipelined(fn func(redis.Pipeliner) error) ([]redis.Cmder, error)

func (*GoRedis) RenameNX

func (cli *GoRedis) RenameNX(key, newKey string) (bool, error)

func (*GoRedis) SAdd

func (cli *GoRedis) SAdd(key string, member interface{}) (int64, error)

////////////////////////////////////// set //////////////////////////////////////

func (*GoRedis) SAdds

func (cli *GoRedis) SAdds(key string, members []interface{}) (int64, error)

func (*GoRedis) SCard

func (cli *GoRedis) SCard(key string) (int64, error)

func (*GoRedis) SDiff

func (cli *GoRedis) SDiff(keys []string) ([]string, error)

func (*GoRedis) SInter

func (cli *GoRedis) SInter(keys []string) ([]string, error)

func (*GoRedis) SIsMember

func (cli *GoRedis) SIsMember(key string, member interface{}) (bool, error)

func (*GoRedis) SMembers

func (cli *GoRedis) SMembers(key string) ([]string, error)

func (*GoRedis) SRem

func (cli *GoRedis) SRem(key string, member interface{}) (int64, error)

func (*GoRedis) SRems

func (cli *GoRedis) SRems(key string, members []interface{}) (int64, error)

func (*GoRedis) SUnion

func (cli *GoRedis) SUnion(keys []string) ([]string, error)

func (*GoRedis) Set

func (cli *GoRedis) Set(key string, value interface{}) error

func (*GoRedis) SetBit

func (cli *GoRedis) SetBit(key string, offset int64, value int) (int64, error)

////////////////////////////////////// bitmap //////////////////////////////////////

func (*GoRedis) SetEx

func (cli *GoRedis) SetEx(key string, value interface{}, expiration int) error

func (*GoRedis) SetNx

func (cli *GoRedis) SetNx(key string, value interface{}) error

func (*GoRedis) SetNxEx

func (cli *GoRedis) SetNxEx(key string, value interface{}, expiration int) (bool, error)

func (*GoRedis) ZAdd

func (cli *GoRedis) ZAdd(key string, value string, score int64) (int64, error)

////////////////////////////////////// sorted set //////////////////////////////////////

func (*GoRedis) ZAddNX

func (cli *GoRedis) ZAddNX(key string, value string, score int64) (int64, error)

func (*GoRedis) ZAdds

func (cli *GoRedis) ZAdds(key string, valueScore map[string]int64) (int64, error)

func (*GoRedis) ZAddsNX

func (cli *GoRedis) ZAddsNX(key string, valueScore map[string]int64) (int64, error)

func (*GoRedis) ZCard

func (cli *GoRedis) ZCard(key string) (int64, error)

func (*GoRedis) ZCount

func (cli *GoRedis) ZCount(key string, min, max int64) (int64, error)

func (*GoRedis) ZRange

func (cli *GoRedis) ZRange(key string, start, end int64) ([]string, error)

func (*GoRedis) ZRangeByScore

func (cli *GoRedis) ZRangeByScore(key string, min, max int64) ([]string, error)

func (*GoRedis) ZRangeByScoreWithScores

func (cli *GoRedis) ZRangeByScoreWithScores(key string, min, max int64) (map[string]int64, error)

func (*GoRedis) ZRangeWithScores

func (cli *GoRedis) ZRangeWithScores(key string, start, end int64) (map[string]int64, error)

func (*GoRedis) ZRem

func (cli *GoRedis) ZRem(key string, fields ...interface{}) (int64, error)

func (*GoRedis) ZRemRangeByScore

func (cli *GoRedis) ZRemRangeByScore(key string, min, max int64) (int64, error)

func (*GoRedis) ZScore

func (cli *GoRedis) ZScore(key string, value string) (int64, error)

type RedisConfig

type RedisConfig struct {
	Addr         []string // 地址
	Type         string   // node/cluster
	Pwd          string   // 密码
	MaxRetries   int      // 最大尝试次数, 默认3
	MinIdleConns int      // 最初连接数, 默认8
}

Jump to

Keyboard shortcuts

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