-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6855665
commit 91310b2
Showing
6 changed files
with
96 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,29 @@ | ||
# rzap | ||
|
||
A rust library for connecting to an openshock server | ||
This library provides an interface to controll shocker devices via [OpenShock](http://openshock.org)'s API | ||
|
||
NOTE: This is an un-official API iterface created by someone who has just started learning rust, no guarantees are made and contributions are greatly welcomed | ||
|
||
``` | ||
[dependencies] | ||
reqwest = { version = "0.11.27" } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_json = "1.0" | ||
strum_macros = "0.26.4" | ||
strum = "0.26.2" | ||
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] } | ||
``` | ||
|
||
## Example | ||
|
||
A simple request to retrieve the API key user's id | ||
|
||
```rs | ||
dotenv().ok(); | ||
let user_test_id = dotenv::var("USER_TEST_ID").expect("missing USER_TEST_ID"); | ||
let openshock_token = dotenv::var("OPENSHOCK_TOKEN").expect("missing OPENSHOCK_TOKEN"); | ||
|
||
let openshock_api = OpenShockAPI::new(None, openshock_token); | ||
println!(openshock_api.get_user_info(None).await.unwrap().id); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,32 @@ | ||
//! # rzap | ||
//! | ||
//! A rust library for connecting to an openshock server | ||
//! # rzap | ||
//! | ||
//! This library provides an interface to controll shocker devices via [OpenShock](http://openshock.org)'s API | ||
//! | ||
//! **NOTE:** This is an un-official API iterface created by someone who has just started learning rust, no guarantees are made and contributions are greatly welcomed | ||
//! | ||
//! ```toml | ||
//! [dependencies] | ||
//! reqwest = { version = "0.11.27" } | ||
//! serde = { version = "1.0", features = ["derive"] } | ||
//! serde_json = "1.0" | ||
//! strum_macros = "0.26.4" | ||
//! strum = "0.26.2" | ||
//! tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] } | ||
//! ``` | ||
//! | ||
//! ## Example | ||
//! | ||
//! A simple request to retrieve the API key user's id | ||
//! | ||
//! ```rs | ||
//! dotenv().ok(); | ||
//! let user_test_id = dotenv::var("USER_TEST_ID").expect("missing USER_TEST_ID"); | ||
//! let openshock_token = dotenv::var("OPENSHOCK_TOKEN").expect("missing OPENSHOCK_TOKEN"); | ||
//! | ||
//! let openshock_api = OpenShockAPI::new(None, openshock_token); | ||
//! println!(openshock_api.get_user_info(None).await.unwrap().id); | ||
//! ``` | ||
//! | ||
pub mod api; | ||
pub mod data_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters