Skip to content

Commit 66fe2c2

Browse files
authored
Merge pull request #916 from flrgh/master
update ngx/openresty annotations
2 parents 9b67d5b + 5f6a00c commit 66fe2c2

File tree

12 files changed

+978
-1580
lines changed

12 files changed

+978
-1580
lines changed

meta/3rd/OpenResty/library/ngx.balancer.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ function balancer.set_current_peer(addr, port) end
4343
---
4444
--- For the best performance, you should use the OpenResty bundle.
4545
---
46-
--- This function was first added in the 0.1.7 version of this library.
47-
---
4846
---@param connect_timeout? number
4947
---@param send_timeout? number
5048
---@param read_timeout? number
@@ -113,8 +111,6 @@ function balancer.set_more_tries(count) end
113111
--- should be made only if you know the request buffer must be regenerated,
114112
--- instead of unconditionally in each balancer retries.
115113
---
116-
--- This function was first added in the 0.1.20 version of this library.
117-
---
118114
---@return boolean ok
119115
---@return string? error
120116
function balancer.recreate_request() end

meta/3rd/OpenResty/library/ngx.errlog.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ function errlog.get_sys_filter_level() end
1616
---
1717
--- This API should always work with directive `lua_capture_error_log`.
1818
---
19-
--- See Nginx log level constants for all nginx log levels.
20-
---
2119
---@param level ngx.log.level
2220
---@return boolean ok
2321
---@return string? err

meta/3rd/OpenResty/library/ngx.lua

Lines changed: 904 additions & 1518 deletions
Large diffs are not rendered by default.

meta/3rd/OpenResty/library/ngx.pipe.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ local proc = {}
129129
---
130130
---@param write_timeout? number
131131
---@param stdout_read_timeout? number
132-
---@param write_timeout? number
132+
---@param stderr_read_timeout? number
133133
---@param wait_timeout? number
134134
function proc:set_timeouts(write_timeout, stdout_read_timeout, stderr_read_timeout, wait_timeout) end
135135

meta/3rd/OpenResty/library/ngx.process.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ local process = {
55

66
--- Returns a number value for the nginx master process's process ID (or PID).
77
---
8-
--- This function requires NGINX 1.13.8+ cores to work properly. Otherwise it returns nil.
9-
---
10-
--- This feature first appeared in lua-resty-core v0.1.14.
118
---@return integer? pid
129
function process.get_master_pid() end
1310

meta/3rd/OpenResty/library/ngx.re.lua

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ re.version = require("resty.core.base").version
2626
---
2727
--- The `jit_stack_size` cannot be set to a value lower than PCRE's default of 32K.
2828
---
29-
--- This method requires the PCRE library enabled in Nginx.
30-
---
31-
--- This feature was first introduced in the v0.1.12 release.
32-
---
3329
---@param option string '"jit_stack_size"'
3430
---@param value any
3531
function re.opt(option, value) end
@@ -58,15 +54,6 @@ function re.opt(option, value) end
5854
--- -- res is now {"a", "b", "c", "d"}
5955
---```
6056
---
61-
--- The optional ctx table argument can be a Lua table holding an optional pos field. When the pos field in the ctx table argument is specified, `split()` will start splitting the subject from that index:
62-
---
63-
---```lua
64-
--- local ngx_re = require "ngx.re"
65-
---
66-
--- local res, err = ngx_re.split("a,b,c,d", ",", nil, {pos = 5})
67-
--- -- res is now {"c", "d"}
68-
---```
69-
---
7057
--- The optional max argument is a number that when specified, will prevent `split()` from adding more than max matches to the res array:
7158
---
7259
---```lua
@@ -104,8 +91,8 @@ function re.opt(option, value) end
10491
---
10592
---@param subj string
10693
---@param regex string
107-
---@param opts string
108-
---@param ctx? table a Lua table holding an optional `pos` field
94+
---@param opts ngx.re.options
95+
---@param ctx? ngx.re.ctx
10996
---@param max? number
11097
---@param res? string[]
11198
---@return string[]? res

meta/3rd/OpenResty/library/ngx.req.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ req.version = require("resty.core.base").version
99
---
1010
---The `header_value` argument can either be a string or a non-empty, array-like table. A nil or empty table value will cause this function to throw an error.
1111
---
12-
---This feature was first introduced in the v0.1.18 release.
13-
---
1412
---@param header_name string must be a non-empty string.
1513
---@param header_value string|string[]
1614
function req.add_header(header_name, header_value) end

meta/3rd/OpenResty/library/ngx.semaphore.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function semaphore:count() end
4747
---
4848
---@param timeout? number
4949
---@return boolean ok
50-
---@return string? error
50+
---@return string|'"timeout"' error
5151
function semaphore:wait(timeout) end
5252

5353

meta/3rd/OpenResty/library/ngx.ssl.clienthello.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ clienthello.version = require("resty.core.base").version
1111
---
1212
---Note that the SNI name is gotten from the raw extensions of the client hello message associated with the current downstream SSL connection.
1313
---
14-
---So this function can only be called in the context of [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block).
14+
---So this function can only be called in the context of `ssl_client_hello_by_lua*`.
1515
---@return string? host
1616
---@return string? error
1717
function clienthello.get_client_hello_server_name() end
@@ -25,7 +25,7 @@ function clienthello.get_client_hello_server_name() end
2525
---
2626
--- Note that the ext is gotten from the raw extensions of the client hello message associated with the current downstream SSL connection.
2727
---
28-
--- So this function can only be called in the context of [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block).
28+
--- So this function can only be called in the context of `ssl_client_hello_by_lua*`.
2929
---
3030
--- Example:
3131
---
@@ -86,9 +86,13 @@ function clienthello.get_client_hello_ext(ext_type) end
8686
--- Returns `true` on success, or a `nil` value and a string describing the error otherwise.
8787
---
8888
--- Considering it is meaningless to set ssl protocols after the protocol is determined,
89-
--- so this function may only be called in the context of [ssl_client_hello_by_lua*](https://github.com/openresty/lua-nginx-module/#ssl_client_hello_by_lua_block).
89+
--- so this function may only be called in the context of `ssl_client_hello_by_lua*`.
90+
---
91+
--- Example:
92+
--- ```lua
93+
--- ssl_clt.set_protocols({"TLSv1.1", "TLSv1.2", "TLSv1.3"})`
94+
--- ```
9095
---
91-
--- Example: `ssl_clt.set_protocols({"TLSv1.1", "TLSv1.2", "TLSv1.3"})`
9296
---@param protocols string[]
9397
---@return boolean ok
9498
---@return string? error

meta/3rd/OpenResty/library/ngx.ssl.lua

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function ssl.set_der_priv_key(der_priv_key) end
2121
---
2222
--- This function can be called in any context.
2323
---
24-
--- This function was first added in version 0.1.7.
25-
---
2624
---@param pem_priv_key string
2725
---@return string? priv_key
2826
---@return string? error
@@ -51,8 +49,6 @@ function ssl.get_tls1_version() end
5149
---
5250
--- Note that this set_cert function will run slightly faster, in terms of CPU cycles wasted, than the set_der_cert variant, since the first function uses opaque cdata pointers which do not require any additional conversion needed to be performed by the SSL library during the SSL handshake.
5351
---
54-
--- This function was first added in version 0.1.7.
55-
---
5652
---@param cert_chain string
5753
---@return boolean ok
5854
---@return string? error
@@ -67,8 +63,6 @@ ssl.TLS1_VERSION=769
6763
---
6864
--- Note that this set_priv_key function will run slightly faster, in terms of CPU cycles wasted, than the set_der_priv_key variant, since the first function uses opaque cdata pointers which do not require any additional conversion needed to be performed by the SSL library during the SSL handshake.
6965
---
70-
--- This function was first added in version 0.1.7.
71-
---
7266
---@param priv_key string
7367
---@return boolean ok
7468
---@return string? error
@@ -166,8 +160,6 @@ function ssl.clear_certs() end
166160
---
167161
--- This function can be called in any context where downstream https is used.
168162
---
169-
--- This function was first introduced in lua-resty-core 0.1.14.
170-
---
171163
---@return string? addr_data
172164
---@return ngx.ssl.addr_type? addr_type
173165
---@return string? error
@@ -182,8 +174,6 @@ function ssl.raw_client_addr() end
182174
---
183175
--- This function can be called in any context.
184176
---
185-
--- This function was first added in version 0.1.7.
186-
---
187177
---@return string? cert_chain
188178
---@return string? error
189179
function ssl.parse_pem_cert(pem_cert_chain) end
@@ -286,7 +276,7 @@ function ssl.cert_pem_to_der(pem_cert_chain) end
286276
---
287277
--- This function was first added in version 0.1.20.
288278
---
289-
---@param ca_certs? # the CA certificate chain opaque pointer returned by the parse_pem_cert function for the current SSL connection. The list of certificates will be sent to clients. Also, they will be added to trusted store. If omitted, will not send any CA certificate to clients.
279+
---@param ca_certs? any # the CA certificate chain opaque pointer returned by the parse_pem_cert function for the current SSL connection. The list of certificates will be sent to clients. Also, they will be added to trusted store. If omitted, will not send any CA certificate to clients.
290280
---@param depth? number verification depth in the client certificates chain. If omitted, will use the value specified by ssl_verify_depth.
291281
---@return boolean ok
292282
---@return string? error

0 commit comments

Comments
 (0)