mirror of
https://github.com/dathere/ckanaction.git
synced 2025-11-09 14:19:49 +00:00
feat: ckanaction crate implementation with GET actions
This commit is contained in:
commit
d0c36b55c6
6 changed files with 3081 additions and 0 deletions
1273
src/lib.rs
Normal file
1273
src/lib.rs
Normal file
File diff suppressed because it is too large
Load diff
19
src/main.rs
Normal file
19
src/main.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use dotenvy::dotenv;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Load environment variables from .env file
|
||||
dotenv()?;
|
||||
|
||||
// Initialize and build CKAN struct
|
||||
let ckan = ckanaction::CKAN::builder()
|
||||
.url("http://localhost:5000")
|
||||
.token(dotenvy::var("CKAN_API_TOKEN")?)
|
||||
.build();
|
||||
|
||||
// Send request to /status_show and print output
|
||||
let status_show = ckan.status_show().await?;
|
||||
println!("{status_show:#?}");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue