Crates.io | jsonbank |
lib.rs | jsonbank |
version | 0.1.9 |
source | src |
created_at | 2023-04-19 22:15:40.197191 |
updated_at | 2024-01-31 16:06:51.705706 |
description | JsonBank.io Rust SDK |
homepage | https://docs.jsonbank.io/sdks/rust |
repository | https://github.com/jsonbankio/rust-sdk |
max_upload_size | |
id | 843962 |
size | 50,830 |
The official repository for the JsonBank.io Rust SDK.
Documentation | crates.io | docs.rs
Add the following to your Cargo.toml file
[dependencies]
jsonbank = "0.1"
Then import the library in your code
use jsonbank::{JsonBank, JsonObject};
fn main() {
let jsb = JsonBank::new_without_config();
// get public content
let data: JsonObject = match jsb.get_content("jsonbank/sdk-test/index.json") {
Ok(data) => data,
Err(err) => panic!("{:?}", err)
};
println!("{:?}", data);
}
Create an .env file in the root of the project and add the following variables
JSB_HOST="https://api.jsonbank.io"
JSB_PUBLIC_KEY="your public key"
JSB_PRIVATE_KEY="your private key"
Then run the tests command below.
Note: A single thread is required for test so that all tests can run in defined order.
cargo test -- --test-threads=1
or using npm because a package.json file is included
npm run test