summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-rpcc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-01-29 16:26:15 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-29 16:26:46 +0100
commit84346cd178ca0740817edc6f81d8f90e7bc6e00c (patch)
treedd8f6dbb041a2813ac5d91571cdac0b3dc004f1a /libs/luci-lib-rpcc
parentcf7e2695cc676dff02561a1a45d6de8140170b17 (diff)
Move inline documentation into separate files.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'libs/luci-lib-rpcc')
-rw-r--r--libs/luci-lib-rpcc/luasrc/rpcc.lua15
-rw-r--r--libs/luci-lib-rpcc/luasrc/rpcc.luadoc36
-rw-r--r--libs/luci-lib-rpcc/luasrc/rpcc/ruci.lua5
-rw-r--r--libs/luci-lib-rpcc/luasrc/rpcc/ruci.luadoc16
4 files changed, 52 insertions, 20 deletions
diff --git a/libs/luci-lib-rpcc/luasrc/rpcc.lua b/libs/luci-lib-rpcc/luasrc/rpcc.lua
index fc52b7eb0..5558910bf 100644
--- a/libs/luci-lib-rpcc/luasrc/rpcc.lua
+++ b/libs/luci-lib-rpcc/luasrc/rpcc.lua
@@ -9,17 +9,10 @@ local nixio = require "nixio", require "nixio.util"
local tostring, assert, setmetatable = tostring, assert, setmetatable
local error = error
---- LuCI RPC Client.
--- @cstyle instance
module "luci.rpcc"
RQLIMIT = 32 * nixio.const.buffersize
---- Create a new JSON-RPC stream client.
--- @class function
--- @param fd File descriptor
--- @param v1 Use protocol version 1.0
--- @return RPC Client
Client = util.class()
function Client.__init__(self, fd, v1)
@@ -29,11 +22,6 @@ function Client.__init__(self, fd, v1)
self.v1 = v1
end
---- Request an RP call and get the response.
--- @param method Remote method
--- @param params Parameters
--- @param notification Notification only?
--- @return response
function Client.request(self, method, params, notification)
local oldchunk = self.decoder and self.decoder.chunk
self.decoder = json.ActiveDecoder(self.fd:blocksource(nil, RQLIMIT))
@@ -58,9 +46,6 @@ function Client.request(self, method, params, notification)
end
end
---- Create a transparent RPC proxy.
--- @param prefix Method prefix
--- @return RPC Proxy object
function Client.proxy(self, prefix)
prefix = prefix or ""
return setmetatable({}, {
diff --git a/libs/luci-lib-rpcc/luasrc/rpcc.luadoc b/libs/luci-lib-rpcc/luasrc/rpcc.luadoc
new file mode 100644
index 000000000..8c90ab524
--- /dev/null
+++ b/libs/luci-lib-rpcc/luasrc/rpcc.luadoc
@@ -0,0 +1,36 @@
+---[[
+LuCI RPC Client.
+
+@cstyle instance
+module "luci.rpcc"
+]]
+
+---[[
+Create a new JSON-RPC stream client.
+
+@class function
+@param fd File descriptor
+@param v1 Use protocol version 1.0
+@return RPC Client
+]]
+
+---[[
+Request an RP call and get the response.
+
+@class function
+@name Client.request
+@param method Remote method
+@param params Parameters
+@param notification Notification only?
+@return response
+]]
+
+---[[
+Create a transparent RPC proxy.
+
+@class function
+@name Client.proxy
+@param prefix Method prefix
+@return RPC Proxy object
+]]
+
diff --git a/libs/luci-lib-rpcc/luasrc/rpcc/ruci.lua b/libs/luci-lib-rpcc/luasrc/rpcc/ruci.lua
index 666d58585..275c39699 100644
--- a/libs/luci-lib-rpcc/luasrc/rpcc/ruci.lua
+++ b/libs/luci-lib-rpcc/luasrc/rpcc/ruci.lua
@@ -5,16 +5,11 @@ local util = require "luci.util"
local rawget, setmetatable = rawget, setmetatable
local ipairs = ipairs
---- Transparent UCI over RPC client.
--- @cstyle instance
module "luci.rpcc.ruci"
local Proxy = util.class()
---- Create a new UCI over RPC proxy.
--- @param rpccl RPC client
--- @return Network transparent UCI module
function factory(rpccl)
return {
cursor = function(...)
diff --git a/libs/luci-lib-rpcc/luasrc/rpcc/ruci.luadoc b/libs/luci-lib-rpcc/luasrc/rpcc/ruci.luadoc
new file mode 100644
index 000000000..980ef46d9
--- /dev/null
+++ b/libs/luci-lib-rpcc/luasrc/rpcc/ruci.luadoc
@@ -0,0 +1,16 @@
+---[[
+Transparent UCI over RPC client.
+
+@cstyle instance
+module "luci.rpcc.ruci"
+]]
+
+---[[
+Create a new UCI over RPC proxy.
+
+@class function
+@name factory
+@param rpccl RPC client
+@return Network transparent UCI module
+]]
+