From 126100ea15b5334075903f7de808e6d8160e7205 Mon Sep 17 00:00:00 2001 From: Gowa2017 <33367355+Gowa2017@users.noreply.github.com> Date: Sun, 10 Oct 2021 21:14:05 +0800 Subject: skynet redis meta --- meta/3rd/skynet/library/skynet/db/redis.lua | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 meta/3rd/skynet/library/skynet/db/redis.lua diff --git a/meta/3rd/skynet/library/skynet/db/redis.lua b/meta/3rd/skynet/library/skynet/db/redis.lua new file mode 100644 index 00000000..322bc2f4 --- /dev/null +++ b/meta/3rd/skynet/library/skynet/db/redis.lua @@ -0,0 +1,44 @@ +---@meta +local redis = {} + +---@class redisconfig +---@field host string +---@field port integer +---@field overload boolean +---@field auth table +---@field db integer +---@field username? string + +---其他指令还可以动态生成 +---更多命令查看 https://www.redis.com.cn/commands.html +local command = {} +function command:disconnect() end +function command:exists(k) end +function command:sismember(key, value) end +function command:pipeline(ops, resp) end + +--- watch mode, only can do SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, PUNSUBSCRIBE, PING and QUIT command. +local watch = {} +function watch:disconnect() end +---阻塞模式读取消息 +function watch:message() end +---subscribe channel +function watch:subscribe(...) end +---pattern subscribe channels +function watch:psubscribe(...) end +---unsubscribe +function watch:unsubscribe(...) end +---punsubscribe +function watch:punsubscribe(...) end + +---connect to redis server +---@param conf redisconfig +---@return command +function redis.connect(conf) end + +---connect to redis server on watch mode +---@param conf redisconfig +---@return watch +function redis.watch(conf) end + +return redis -- cgit v1.2.3