mirror of
https://github.com/dathere/ckanaction.git
synced 2026-05-20 01:44:16 +00:00
chore: examples update and docs, add package-list example
This commit is contained in:
parent
4ff1155d9b
commit
a88a8fffc3
8 changed files with 2299 additions and 275 deletions
15
examples/package-list/src/main.rs
Normal file
15
examples/package-list/src/main.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use ckanaction::CKANError;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), CKANError> {
|
||||
// Initialize and build CKAN struct
|
||||
let ckan = ckanaction::CKAN::builder()
|
||||
.url("http://localhost:5000")
|
||||
.build();
|
||||
|
||||
// Send request to /package_list and print formatted debug output
|
||||
let package_list = ckan.package_list().call().await?;
|
||||
println!("{package_list:#?}");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue