You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/10/11 16:22:53 UTC
[incubator-ponymail] branch master updated: Better key names
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git
The following commit(s) were added to refs/heads/master by this push:
new d5cd7d4 Better key names
d5cd7d4 is described below
commit d5cd7d4733ae70e62237d7f6b1240a46ffb148f1
Author: Sebb <se...@apache.org>
AuthorDate: Mon Oct 11 17:22:11 2021 +0100
Better key names
---
test/stats_cli.lua | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/test/stats_cli.lua b/test/stats_cli.lua
index 1f69e4d..f563651 100755
--- a/test/stats_cli.lua
+++ b/test/stats_cli.lua
@@ -24,7 +24,7 @@ local _CACHE = {} -- capture output
http.request = function(url, data)
-- capture HTTP parameters (assume only called once)
_CACHE.url = url
- _CACHE.query = JSON.decode(data)
+ _CACHE.querydata = JSON.decode(data)
-- return simplest result that satisfies stats.lua
result = [[
{
@@ -46,7 +46,7 @@ r.ivm_get = function(r, key)
end
-- collect output (assume only one call to puts)
-r.puts = function(r, ...) _CACHE.puts = JSON.decode(...) end
+r.puts = function(r, ...) _CACHE.reply = JSON.decode(...) end
-- TODO
r.escape_html = function(r, val)
@@ -80,19 +80,10 @@ then
end
res = test(data)
if os.getenv("MODE") == "inspect" then
- print(inspect(res["query"]))
+ print(inspect(res["querydata"]))
else
print(JSON.encode(res))
end
else
print("Need even arg count")
end
--- for k,v in pairs(arg) do
--- if k > 0
--- then
--- print(v)
--- test(JSON.decode(v))
--- end
--- end
--- test({d='lte=123d'},{gte = "now-123d", lte ='now+1d'})
--- test({d='gte=123d', header_from='a/b/c'},{lte = "now-123d"})
\ No newline at end of file