mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 17:52:24 +00:00
add examples of lua scripts
This commit is contained in:
8
com/Utils/Echo.lua
Normal file
8
com/Utils/Echo.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
if not In.Params.msg or In.Params.msg == "" then
|
||||
Out.Error = {
|
||||
message = "there must be a msg parameter"
|
||||
}
|
||||
return
|
||||
end
|
||||
|
||||
Out.Result.answer = In.Params.msg
|
||||
1
com/Utils/Ping.lua
Normal file
1
com/Utils/Ping.lua
Normal file
@@ -0,0 +1 @@
|
||||
Out.Result.answer = "pong"
|
||||
13
com/echo.lua
13
com/echo.lua
@@ -1,13 +0,0 @@
|
||||
--- #description = "Echoes back the message."
|
||||
--- #args
|
||||
--- msg = the message
|
||||
|
||||
if not In.Params.msg or In.Params.msg == "" then
|
||||
Out.Result.status = Status.error
|
||||
Out.Result.error = "Missing parameter: msg"
|
||||
return
|
||||
end
|
||||
|
||||
Out.Result.status = Status.ok
|
||||
Out.Result.answer = In.Params.msg
|
||||
return
|
||||
Reference in New Issue
Block a user