docs: correct @tparam format (#6915)

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
罗泽轩 2022-04-27 17:08:54 +08:00 committed by GitHub
parent 7b4bbba6b9
commit 7fe94aaf41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View File

@ -613,7 +613,7 @@ end
-- This function should be used in the `init_worker_by_lua` phase.
--
-- @function core.config.new
-- @tparam string etcd directory to be monitored, e.g. "/routes".
-- @tparam string key etcd directory to be monitored, e.g. "/routes".
-- @tparam table opts Parameters related to the etcd client connection.
-- The keys in `opts` are as follows:
-- * automatic: whether to get the latest etcd data automatically

View File

@ -90,7 +90,7 @@ end
-- A value without a suffix means seconds.
--
-- @function core.config_util.parse_time_unit
-- @tparam number|string Strings with time units, e.g. "60m".
-- @tparam number|string s Strings with time units, e.g. "60m".
-- @treturn number Number of seconds after conversion
-- @usage
-- local seconds = core.config_util.parse_time_unit("60m") -- 3600

View File

@ -108,7 +108,7 @@ local delay_tab = setmetatable({data = "", force = false}, {
--
-- @function core.json.delay_encode
-- @tparam string|table data The data to be encoded.
-- @tparam boolean force Whether to clear the log buffer.
-- @tparam boolean force encode data can't be encoded as JSON with tostring
-- @treturn table The table with the __tostring function overridden.
-- @usage
-- core.log.info("conf : ", core.json.delay_encode(conf))

View File

@ -37,8 +37,8 @@ local _M = {}
-- Returns the connected xRPC upstream socket according to the configuration
--
-- @function xrpc.sdk.connect_upstream
-- @tparam table selected upstream node
-- @tparam table upstream configuration
-- @tparam table node selected upstream node
-- @tparam table up_conf upstream configuration
-- @treturn table|nil the xRPC upstream socket, or nil if failed
function _M.connect_upstream(node, up_conf)
local sk = xrpc_socket.upstream.socket()
@ -67,9 +67,9 @@ end
-- Returns disconnected xRPC upstream socket according to the configuration
--
-- @function xrpc.sdk.disconnect_upstream
-- @tparam table xRPC upstream socket
-- @tparam table upstream configuration
-- @tparam boolean is the upstream already broken
-- @tparam table upstream xRPC upstream socket
-- @tparam table up_conf upstream configuration
-- @tparam boolean upstream_broken whether the upstream is already broken
function _M.disconnect_upstream(upstream, up_conf, upstream_broken)
if upstream_broken then
upstream:close()
@ -84,8 +84,8 @@ end
-- Returns the request level ctx with an id
--
-- @function xrpc.sdk.get_req_ctx
-- @tparam table xrpc session
-- @tparam string optional ctx id
-- @tparam table session xrpc session
-- @tparam string id ctx id
-- @treturn table the request level ctx
function _M.get_req_ctx(session, id)
if not id then
@ -111,8 +111,8 @@ end
-- Returns the new router if the stream routes are changed
--
-- @function xrpc.sdk.get_router
-- @tparam table xrpc session
-- @tparam string the current router version, should come from the last call
-- @tparam table session xrpc session
-- @tparam string version the current router version, should come from the last call
-- @treturn boolean whether there is a change
-- @treturn table the new router under the specific protocol
-- @treturn string the new router version
@ -153,8 +153,8 @@ end
-- Set the session's current upstream according to the route's configuration
--
-- @function xrpc.sdk.set_upstream
-- @tparam table xrpc session
-- @tparam table the route configuration
-- @tparam table session xrpc session
-- @tparam table conf the route configuration
-- @treturn nil|string error message if present
function _M.set_upstream(session, conf)
local up