--- /dev/null
+\r
+local actions = {};\r
+\r
+function register(path, t)\r
+ local curr = actions;\r
+ for comp in path:gmatch("([^/]+)/") do\r
+ if curr[comp] == nil then\r
+ curr[comp] = {};\r
+ end\r
+ curr = curr[comp];\r
+ if type(curr) ~= "table" then\r
+ return nil, "path-taken";\r
+ end\r
+ end\r
+ curr[path:match("/([^/]+)$")] = t;\r
+ return true;\r
+end\r
+\r
+return { actions = actions, register= register };
\ No newline at end of file
local eventmanager = require "core.eventmanager";
local config = require "core.configmanager";
local multitable_new = require "util.multitable".new;
-
+local register_actions = require "core.actions".register;
local loadfile, pcall = loadfile, pcall;
local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv;
--------------------------------------------------------------------
+local actions = {};
+
+function actions.load(params)
+ --return true, "Module loaded ("..params.module.." on "..params.host..")";
+ return load(params.host, params.module);
+end
+
+function actions.unload(params)
+ return unload(params.host, params.module);
+end
+
+register_actions("/modules", actions);
+
return _M;