build: remove dotenvy

This commit is contained in:
rzmk 2025-05-02 09:21:16 -04:00
parent 5376002177
commit 0d29a691c0
No known key found for this signature in database
4 changed files with 6 additions and 16 deletions

7
Cargo.lock generated
View file

@ -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"

View file

@ -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"

View file

@ -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`.
![ckanaction IDE hints demo](https://github.com/user-attachments/assets/515d5742-4a33-43b9-9f3f-4795d18579c0) ![ckanaction IDE hints demo](https://github.com/user-attachments/assets/515d5742-4a33-43b9-9f3f-4795d18579c0)
@ -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).

View file

@ -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