aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-04 19:54:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-04 19:54:30 +0100
commitfef2b7ffe26086b2c696b654bdf67f769e2d8344 (patch)
treedae6f6d20c913fc47b2e87ff425b9927f5bdcde6 /lualib
parentb6516075d6881756589a60cccb8769726c1a2a02 (diff)
downloadrspamd-fef2b7ffe26086b2c696b654bdf67f769e2d8344.tar.gz
rspamd-fef2b7ffe26086b2c696b654bdf67f769e2d8344.zip
[Minor] Add methods to display selectors lists
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_selectors.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua
index 995617ca0..20814466c 100644
--- a/lualib/lua_selectors.lua
+++ b/lualib/lua_selectors.lua
@@ -665,4 +665,20 @@ exports.combine_selectors = function(_, selectors, delimiter)
end
end
+local function display_selectors(tbl)
+ return fun.tomap(fun.map(function(k,v)
+ return k, fun.tomap(fun.filter(function(kk, vv)
+ return type(vv) ~= 'function'
+ end, v))
+ end, tbl))
+end
+
+exports.list_extractors = function()
+ return display_selectors(extractors)
+end
+
+exports.list_transforms = function()
+ return display_selectors(transform_function)
+end
+
return exports \ No newline at end of file