MINOR: lua: Allow reading "proc." scoped vars from LUA core.

This adds the "core.get_var()" method allow the reading
of "proc." scoped variables outside of TXN or HTTP/TCPApplet.

Fixes: #2212
Signed-off-by: Daan van Gorkum <djvg@djvg.net>
This commit is contained in:
Daan van Gorkum
2023-07-12 13:11:24 +08:00
committed by Willy Tarreau
parent 083f917fe2
commit f034139bc0
2 changed files with 38 additions and 0 deletions

View File

@@ -381,6 +381,16 @@ Core class
:returns: an array of values.
.. js:function:: core.get_var()
**context**: body, init, task, action, sample-fetch, converter
Returns data stored in the variable <var> converter in Lua type.
This is limited to "proc." scoped variables.
:param string var: The variable name in "proc." scope according with the
HAProxy variable syntax.
.. js:function:: core.now()
**context**: body, init, task, action