RedisClient class

A client for interacting with a Redis server. 与Redis服务器交互的客户端。

Constructors

RedisClient({RedisSocketOptions? socket, RedisCommandOptions command = const RedisCommandOptions(), RedisLogger logger = const _NoopRedisLogger()})
A client for interacting with a Redis server. 与Redis服务器交互的客户端。

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

auth(String password) Future<void>
------------------------------ scripting ------------------------------ ------------------------------ connection ------------------------------ auth
clientList() Future<ClientList>
------------------------------ server ------------------------------ clientList
close() Future<void>
终止与Redis服务器的连接并关闭客户端 调用此方法后,客户端实例不再可用。 当你使用完客户端和/或希望调用这个方法 阻止重新连接。
connect() Future<void>
Establish a connection to the Redis server. The delay between connection attempts. 与Redis服务器建立连接 连接尝试之间的延迟。
dbsize() Future<int>
dbsize
decr(String key) Future<int>
------------------------------ String ------------------------------ decr
decrby(String key, int increment) Future<int>
decrby
del(List<String> keys) Future<int>
------------------------------ Key ------------------------------ del
discard() Future<void>
------------------------------ transactions ------------------------------ discard
disconnect() Future<void>
Terminate the connection to the Redis server.
exec() Future<void>
exec
execute(String str) Future<Execute>
execute
exists(List<String> keys) Future<int>
exists
expire(String key, Duration timeout) Future<bool>
expire
flushAll({bool? doAsync}) Future<void>
flushAll
flushDb({bool? doAsync}) Future<void>
flushDb
geoAdd(String key, double longitude, double latitude, String member) Future<int>
------------------------------ HyperLogLog ------------------------------ ------------------------------ Geo ------------------------------ geoAdd
geoDist(String key, String member1, String member2, [String? unit]) Future<String?>
geoDist
geoHash(String key, List<Object> members) Future<List<String?>>
geoHash
geoPos(String key, List<Object> members) Future<GeoPos>
geoHash
get(String key) Future<String?>
get
hdel(String key, List<String> fields) Future<int>
------------------------------ Hash ------------------------------ hdel
hexists(String key, String field) Future<bool>
hexists
hget(String key, String field) Future<String?>
hget
hgetall(String key) Future<Map<String, String?>>
hgetall
hkeys(String key) Future<List<String?>>
hkeys
hlen(String key) Future<int>
hlen
hmset(String key, Map<Object, Object> values) Future<void>
hmset
hscan(String key, int cursor, {String? pattern, int? count}) Future<Hscan>
hscan
hset(String key, String field, Object value) Future<int>
hset
hvals(String key) Future<List<String?>>
hvals
incr(String key) Future<int>
incr
incrby(String key, int increment) Future<int>
incrby
info([String? section]) Future<Info>
info
jsonArrAppend(String key, Object value, {String path = '\$'}) Future<int>
------------------------------ json ------------------------------ https://redis.io/docs/latest/develop/data-types/json/ jsonArrAppend
jsonArrIndex(String key, Object value, {String path = '\$', int? start, int? end}) Future<int>
jsonArrIndex
jsonArrInsert(String key, Object value, {String path = '\$', int? start, int? end}) Future<int>
jsonArrInsert
jsonArrLen(String key, {String path = '\$'}) Future<int>
jsonArrLen
jsonArrPop(String key, {String path = '\$', int index = 0}) Future<String>
jsonArrPop
jsonArrTrim(String key, {String path = '\$', int start = 0, int stop = 0}) Future<int>
jsonArrTrim
jsonClear(String key, {String path = '\$'}) Future<int>
jsonClear
jsonDel(String key, {String path = '\$'}) Future<int>
jsonDel
jsonForget(String key, {String path = '\$'}) Future<int>
jsonForget
jsonGet(String key, {String path = '\$'}) Future<String?>
jsonGet
jsonMerge(String key, {String path = '\$', required dynamic value}) Future<void>
jsonMerge
jsonMget(List<String> keys, {String path = '\$'}) Future<List<String?>>
jsonMget
jsonMset(String key, {String path = '\$', required dynamic value}) Future<void>
jsonMset
jsonNumincrby(String key, {String path = '\$', required dynamic value}) Future<String?>
jsonNumincrby
jsonNummultby(String key, {String path = '\$', required dynamic value}) Future<String?>
jsonNummultby
jsonSet({required String key, String path = '\$', required dynamic value, bool nx = false, bool xx = false}) Future<void>
jsonObjkeys todo待解决 jsonSet
jsonStrlen(String key, {String path = '\$'}) Future<int>
jsonStrappend jsonStrlen
llen(String key) Future<int>
------------------------------ List ------------------------------ llen
lpush(String key, List<Object> values) Future<int>
lpush
lrange(String key, int start, int stop) Future<List<String?>>
lrange
lrem(String key, int count, Object value) Future<int>
lrem
lset(String key, int index, Object value) Future<void>
lset
moduleList() Future<ModuleList>
------------------------------ Commands ------------------------------ moduleList
multi() Future<void>
multi
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pexpire(String key, Duration timeout) Future<bool>
pexpire
ping() Future<void>
ping
psubscribe(List<String> pattern) Stream<Psubscribe>
------------------------------ PubSub ------------------------------ psubscribe
publish(String channel, Object message) Future<int>
publish
rename(String keyName, String newKeyName) Future<void>
rename
rpush(String key, List<Object> values) Future<int>
rpush
sadd(String key, List<Object> values) Future<int>
------------------------------ Set ------------------------------ sadd
scan(int cursor, {String? pattern, int? count}) Future<Scan>
scan
scard(String key) Future<int>
scard
select(int index) Future<void>
select
set(Object key, Object value, {Duration? ex, DateTime? exat, Duration? px, DateTime? pxat, bool nx = false, bool xx = false, bool get = false}) Future<Set>
set
slowlogGet({int? count}) Future<SlowlogGet>
slowlogGet
slowlogLen() Future<int>
slowlogLen
slowlogReset() Future<void>
slowlogReset
smembers(String key) Future<List<String?>>
smembers
srem(String key, List<Object> members) Future<int>
srem
sscan(String key, int cursor, {String? pattern, int? count}) Future<Sscan>
sscan
strlen(String key) Future<int>
strlen
subscribe(List<String> channels) Stream<Subscribe>
subscribe
toString() String
A string representation of this object.
inherited
ttl(String key) Future<int>
ttl
type(String key) Future<String>
type
unwatch() Future<void>
unwatch
watch(List<String> keys) Future<void>
watch
zadd(String key, Map<Object, double> values) Future<int>
------------------------------ SortedSet ------------------------------ zadd
zcard(String key) Future<int>
zcard
zrange(String key, int start, int stop) Future<Map<String, double>>
zrange
zrem(String key, List<Object> members) Future<int>
zrem
zscan(String key, int cursor, {String? pattern, int? count}) Future<Zscan>
zscan

Operators

operator ==(Object other) bool
The equality operator.
inherited