summaryrefslogtreecommitdiffhomepage
path: root/libs/lucid-rpc/luasrc/lucid/rpc/system.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-06-14 08:51:43 +0000
committerSteven Barth <steven@midlink.org>2009-06-14 08:51:43 +0000
commitc47be2e727d1bb3e2e3aa415ec96be2a5f8a45b7 (patch)
tree40d9202363c5e81f9fe38b4d52a1cfa889792cda /libs/lucid-rpc/luasrc/lucid/rpc/system.lua
parentf9263e00c1371eff6ace0252143236d6bf6f2ce2 (diff)
GSoC: Documentation #2
Diffstat (limited to 'libs/lucid-rpc/luasrc/lucid/rpc/system.lua')
-rw-r--r--libs/lucid-rpc/luasrc/lucid/rpc/system.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/libs/lucid-rpc/luasrc/lucid/rpc/system.lua b/libs/lucid-rpc/luasrc/lucid/rpc/system.lua
index 4f7f0b5c2..cf3aa6abe 100644
--- a/libs/lucid-rpc/luasrc/lucid/rpc/system.lua
+++ b/libs/lucid-rpc/luasrc/lucid/rpc/system.lua
@@ -17,8 +17,10 @@ local srv = require "luci.lucid.rpc.server"
local nixio = require "nixio"
local lucid = require "luci.lucid"
+--- Internal system functions.
module "luci.lucid.rpc.system"
+-- Prepare the RPC module.
function _factory()
local mod = srv.Module("System functions"):register({
echo = echo,
@@ -34,15 +36,22 @@ function _factory()
return mod
end
-
+--- Simple echo test function.
+-- @param object to be echoed object
+-- @return echo object
function echo(object)
return object
end
+--- Simple void test function.
function void()
end
+--- Accumulate different requests and execute them.
+-- @param session Session object
+-- @param ...
+-- @return overall response object
function multicall(session, ...)
local server, responses, response = session.server, {}, nil
for k, req in ipairs({...}) do
@@ -69,6 +78,12 @@ function multicall(session, ...)
return responses
end
+--- Create or use a new authentication token.
+-- @param session Session object
+-- @param type Authentication type
+-- @param entity Authentication enttity (username)
+-- @param key Authentication key (password)
+-- @return boolean status
function authenticate(session, type, entity, key)
if not type then
session.user = nil