Skip to content

Commit 15ab6b3

Browse files
committed
Added shm:get(_stale)? flag matching to docs
1 parent d4c6557 commit 15ab6b3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.markdown

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6827,12 +6827,15 @@ This feature was first introduced in the `v0.3.1rc22` release.
68276827
ngx.shared.DICT.get
68286828
-------------------
68296829

6830-
**syntax:** *value, flags = ngx.shared.DICT:get(key)*
6830+
**syntax:** *value, flags, flags_match = ngx.shared.DICT:get(key, flags?)*
68316831

68326832
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua**
68336833

68346834
Retrieving the value in the dictionary [ngx.shared.DICT](#ngxshareddict) for the key `key`. If the key does not exist or has expired, then `nil` will be returned.
68356835

6836+
If flags is not `nil`, value will only be returned if flags do not match with shm.
6837+
A 3rd return argument will indicate if flags matched.
6838+
68366839
In case of errors, `nil` and a string describing the error will be returned.
68376840

68386841
The value returned will have the original data type when they were inserted into the dictionary, for example, Lua booleans, numbers, or strings.
@@ -6866,7 +6869,7 @@ See also [ngx.shared.DICT](#ngxshareddict).
68666869
ngx.shared.DICT.get_stale
68676870
-------------------------
68686871

6869-
**syntax:** *value, flags, stale = ngx.shared.DICT:get_stale(key)*
6872+
**syntax:** *value, flags, stale, flags_match = ngx.shared.DICT:get_stale(key, flags?)*
68706873

68716874
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua**
68726875

doc/HttpLuaModule.wiki

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5778,12 +5778,15 @@ This feature was first introduced in the <code>v0.3.1rc22</code> release.
57785778
57795779
== ngx.shared.DICT.get ==
57805780
5781-
'''syntax:''' ''value, flags = ngx.shared.DICT:get(key)''
5781+
'''syntax:''' ''value, flags, flags_match = ngx.shared.DICT:get(key, flags?)''
57825782
57835783
'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*''
57845784
57855785
Retrieving the value in the dictionary [[#ngx.shared.DICT|ngx.shared.DICT]] for the key <code>key</code>. If the key does not exist or has expired, then <code>nil</code> will be returned.
57865786
5787+
If flags is not <code>nil</code>, value will only be returned if flags do not match with shm.
5788+
A 3rd return argument will indicate if flags matched.
5789+
57875790
In case of errors, <code>nil</code> and a string describing the error will be returned.
57885791
57895792
The value returned will have the original data type when they were inserted into the dictionary, for example, Lua booleans, numbers, or strings.
@@ -5812,7 +5815,7 @@ See also [[#ngx.shared.DICT|ngx.shared.DICT]].
58125815
58135816
== ngx.shared.DICT.get_stale ==
58145817
5815-
'''syntax:''' ''value, flags, stale = ngx.shared.DICT:get_stale(key)''
5818+
'''syntax:''' ''value, flags, stale, flags_match = ngx.shared.DICT:get_stale(key, flags?)''
58165819
58175820
'''context:''' ''set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua*''
58185821

0 commit comments

Comments
 (0)