mirror of
https://github.com/dathere/ckanaction.git
synced 2025-11-09 14:19:49 +00:00
build: remove dotenvy
This commit is contained in:
parent
5376002177
commit
0d29a691c0
4 changed files with 6 additions and 16 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -113,7 +113,6 @@ name = "ckanaction"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bon",
|
"bon",
|
||||||
"dotenvy",
|
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
@ -182,12 +181,6 @@ dependencies = [
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dotenvy"
|
|
||||||
version = "0.15.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encoding_rs"
|
name = "encoding_rs"
|
||||||
version = "0.8.35"
|
version = "0.8.35"
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,13 @@
|
||||||
name = "ckanaction"
|
name = "ckanaction"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
description = "Rust library crate featuring an API wrapper of the CKAN Action v3 API."
|
||||||
|
repository = "https://github.com/dathere/ckanaction"
|
||||||
|
keywords = ["ckan"]
|
||||||
|
categories = ["api-bindings", "asynchronous"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bon = "3.6.3"
|
bon = "3.6.3"
|
||||||
dotenvy = "0.15.7"
|
|
||||||
reqwest = { version = "0.12.15", features = ["json", "multipart", "stream"] }
|
reqwest = { version = "0.12.15", features = ["json", "multipart", "stream"] }
|
||||||
serde = "1.0.219"
|
serde = "1.0.219"
|
||||||
serde_json = "1.0.140"
|
serde_json = "1.0.140"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# ckanaction
|
# ckanaction
|
||||||
|
|
||||||
Rust library crate to access CKAN Action API endpoints through Rust builders. Based on the CKAN Action API v3. Endpoints are expected to return with an output of type `serde_json::Value`.
|
Rust library crate to access [CKAN](https://ckan.org) Action API endpoints through Rust builders. Based on the CKAN Action API v3. Endpoints are expected to return with an output of type `serde_json::Value`.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
@ -76,5 +76,4 @@ println!("{status_show:#?}");
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- Add the `CKAN_API_TOKEN` environment variable to a `.env` file where the program runs to include the token when making requests to the CKAN API.
|
|
||||||
- If you use a `maybe_fn()` then if you provide `None` it will be ignored and that parameter will not be added to the JSON body. This library assumes `None` would not be provided as a value (since the cases where it is a value is often the default value that the CKAN API already has set for that parameter).
|
- If you use a `maybe_fn()` then if you provide `None` it will be ignored and that parameter will not be added to the JSON body. This library assumes `None` would not be provided as a value (since the cases where it is a value is often the default value that the CKAN API already has set for that parameter).
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,9 @@
|
||||||
use dotenvy::dotenv;
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// Load environment variables from .env file
|
|
||||||
dotenv()?;
|
|
||||||
|
|
||||||
// Initialize and build CKAN struct
|
// Initialize and build CKAN struct
|
||||||
let ckan = ckanaction::CKAN::builder()
|
let ckan = ckanaction::CKAN::builder()
|
||||||
.url("http://localhost:5000")
|
.url("http://localhost:5000")
|
||||||
.token(dotenvy::var("CKAN_API_TOKEN")?)
|
.token("CKAN_API_TOKEN".to_string())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Send request to /status_show and print output
|
// Send request to /status_show and print output
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue