Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

kuzzleio/sdk-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Official Kuzzle LUA SDK - ALPHA VERSION

About Kuzzle

A backend software, self-hostable and ready to use to power modern apps.

You can access the Kuzzle repository on Github

SDK Documentation

The complete SDK documentation is available here

Protocol used

The LUA SDK implements the websocket protocol.

Dependencies

You need the liblua5.3-dev.

Build

Execute the following snippet to clone the GIT repository, and build the SDK. It will then be available in the "build/" directory

git clone --recursive git@github.com:kuzzleio/sdk-lua.git
git submodule update --init --recursive
cd sdk-lua
make

Example

require('kuzzlesdk');

kuzzle = kuzzlesdk.Kuzzle("localhost");

-- connect
kuzzle:connect();
-- get Kuzzle timestamp
timestamp = kuzzle.server:now();
print(timestamp);

-- Create an index
kuzzle.index:create("index");
-- Create a collection in the index
kuzzle.collection:create("index", "collection")

-- Create a document in the collection
res = kuzzle.document:create("index", "collection", "", "{\"name\": \"Joe\"}");
-- Print the json response
print(res);
-- Disconnect from Kuzzle
kuzzle:disconnect();