cmd

package
v0.0.0-...-be7fb97 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXTRA_EXPIRE int = 0
)

Variables

View Source
var (
	CmdSet       []RedisCmd
	CmdAvailable map[RedisCmd]bool
)

Functions

func Del

func Del(key string)

Del 该命令用于在 key 存在时删除 key

func Get

func Get(key string) string

Get 获取指定 key 的值

func Hdel

func Hdel(key string, field string)

Hdel 删除一个哈希表字段

func Hget

func Hget(key string, field string) string

Hget 获取存储在哈希表中指定字段的值

func Hgetall

func Hgetall(key string) string

Hgetall 获取在哈希表中指定 key 的所有字段和值

func Hkeys

func Hkeys(key string) string

Hkeys 获取所有哈希表中的字段

func Hset

func Hset(key string, field string, value string, extra ...string)

Hset 将哈希表 key 中的字段 field 的值设为 value

func Hvals

func Hvals(key string) string

Hvals 获取哈希表中所有值

func Llen

func Llen(key string) string

Llen 获取列表长度

func Lpop

func Lpop(key string) (member string)

Lpop 移出并获取列表的第一个元素

func Lpush

func Lpush(key string, value string, extra ...string)

Lpush 将一个值插入到列表头部

func Lrange

func Lrange(key string, start string, stop string) string

Lrange 获取列表指定范围内的元素

func Rpop

func Rpop(key string) (member string)

Rpop 移出并获取列表的最后一个元素

func Rpush

func Rpush(key string, value string, extra ...string)

Rpush 将一个值插入到列表尾部

func Sadd

func Sadd(key string, member string, extra ...string)

Sadd 向集合添加一个成员

func Set

func Set(key string, value string, extra ...string)

Set 设置指定 key 的值

func Smembers

func Smembers(key string) (members string)

Smembers 返回集合中的所有成员

func Spop

func Spop(key string) (member string)

Spop 移除并返回集合中的一个随机元素

func Srem

func Srem(key string, member string)

Srem 移除集合中一个成员

func Zadd

func Zadd(key string, score string, member string, extra ...string)

Zadd 向有序集合添加一个成员,或者更新已存在成员的分数

func Zrangebyscore

func Zrangebyscore(key string, min string, max string) string

Zrangebyscore 通过分数返回有序集合指定区间内的成员

func Zrem

func Zrem(key string, member string)

Zrem 移除有序集合中的一个成员

func Zscore

func Zscore(key string, member string) string

Zscore 返回有序集中,成员的分数值

Types

type RedisCmd

type RedisCmd string
const (
	SET           RedisCmd = "set"
	GET           RedisCmd = "get"
	DEL           RedisCmd = "del"
	HSET          RedisCmd = "hset"
	HGET          RedisCmd = "hget"
	HGETALL       RedisCmd = "hgetall"
	HKEYS         RedisCmd = "hkeys"
	HVALS         RedisCmd = "hvals"
	HDEL          RedisCmd = "hdel"
	LPUSH         RedisCmd = "lpush"
	LPOP          RedisCmd = "lpop"
	RPUSH         RedisCmd = "rpush"
	RPOP          RedisCmd = "rpop"
	LRANGE        RedisCmd = "lrange"
	LLEN          RedisCmd = "llen"
	SADD          RedisCmd = "sadd"
	SMEMBERS      RedisCmd = "smembers"
	SPOP          RedisCmd = "spop"
	SREM          RedisCmd = "srem"
	ZADD          RedisCmd = "zadd"
	ZRANGEBYSCORE RedisCmd = "zrangebyscore"
	ZSCORE        RedisCmd = "zscore"
	ZREM          RedisCmd = "zrem"
)

Jump to

Keyboard shortcuts

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