summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGowa2017 <33367355+Gowa2017@users.noreply.github.com>2021-10-10 21:14:05 +0800
committerGowa2017 <33367355+Gowa2017@users.noreply.github.com>2021-10-10 21:14:05 +0800
commit126100ea15b5334075903f7de808e6d8160e7205 (patch)
tree19d26d794254b91ae4bad58143b209a915cc2c70
parent8f24287d7f1190a5fff5f85de3f403d84bebf79c (diff)
downloadlua-language-server-126100ea15b5334075903f7de808e6d8160e7205.zip
skynet redis meta
-rw-r--r--meta/3rd/skynet/library/skynet/db/redis.lua44
1 files changed, 44 insertions, 0 deletions
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