Skip to main content

gamend

The Gamend backend: a session, its REST API, and a realtime socket carrying topics and server hooks. Every call returns an id to await, and each result also reaches the handler method of the node it was given (on_gamend_event unless on_event names another) as a map tagged with a kind.

9 functions, 0 constants. Scripts reach it as gamend::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

functionacts onwhat it does
call_hook(int, string, string, any?) -> anyCall a server plugin's function over the socket; the reply's response holds data or error.
close(int) -> anyShut the socket down; false when the connection was already gone.
configure(string)Point the plugin at a server's base url; every other call errors until this one runs.
connect(any, any?) -> anyOpen the realtime socket and return the id join, push, leave, call_hook and close take.
join(int, string, any?) -> anySubscribe the socket to a topic and return the id the server's reply answers.
leave(int, string) -> anyUnsubscribe the socket from a topic, returning the id the reply answers.
login(any, any?, any?) -> anyOpen a session from a device_id, or an email and password, and return the id its login result answers.
push(int, string, string, any?) -> anySend an event and its payload to a topic on the socket, returning the id the reply answers.
rest(any, string, string, any?) -> anyCall a path on the configured server over HTTP; the result carries the status and the decoded body.