https://github.com/alexandrebouthinon/kuzzle-rs
Kuzzle Rust SDK
https://github.com/alexandrebouthinon/kuzzle-rs
hacktoberfest kuzzle kuzzle-sdk
Last synced: 3 months ago
JSON representation
Kuzzle Rust SDK
- Host: GitHub
- URL: https://github.com/alexandrebouthinon/kuzzle-rs
- Owner: alexandrebouthinon
- License: apache-2.0
- Created: 2021-10-11T21:38:41.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-20T08:58:02.000Z (over 3 years ago)
- Last Synced: 2025-02-01T00:27:52.775Z (5 months ago)
- Topics: hacktoberfest, kuzzle, kuzzle-sdk
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
## Usage
The SDK supports different protocols. When instantiating,
you must choose the protocol to use and fill in the different options needed to connect to Kuzzle.```rust
use kuzzle::protocols::WebSocket;
use kuzzle::{request, Kuzzle};#[async_std::main]
async fn main() -> Result<(), Box> {
let mut k = Kuzzle::new(WebSocket::new("localhost", None));
k.connect().await?;let request = request!({
"controller": "server",
"action": "now"
})?;let response = k.query(&request).await?;
match response.get_result() {
Some(result) => println!("Kuzzle current Epoc timestamp: {}", &result["now"]),
None => eprintln!("No timestamp was reveived from the Kuzzle server!"),
}k.disconnect().await
}
```## About
### Kuzzle
Kuzzle is an open-source backend that includes a scalable server, a multiprotocol API,
an administration console and a set of plugins that provide advanced functionalities like real-time pub/sub, blazing fast search and geofencing.* :octocat: __[Github](https://github.com/kuzzleio/kuzzle)__
* :earth_africa: __[Website](https://kuzzle.io)__
* :books: __[Documentation](https://docs.kuzzle.io)__
* :email: __[Discord](http://join.discord.kuzzle.io)__