mirror of
https://github.com/dathere/ckanaction.git
synced 2026-05-20 09:54:14 +00:00
Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b8ffbf53c | ||
|
|
83eb41510f | ||
|
|
a88a8fffc3 | ||
|
|
4ff1155d9b | ||
|
|
cd565bbda0 |
13 changed files with 2331 additions and 305 deletions
50
Cargo.lock
generated
50
Cargo.lock
generated
|
|
@ -65,9 +65,9 @@ checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.61"
|
||||
version = "1.2.62"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d"
|
||||
checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98"
|
||||
dependencies = [
|
||||
"find-msvc-tools",
|
||||
"shlex",
|
||||
|
|
@ -349,9 +349,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.17.0"
|
||||
version = "0.17.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51"
|
||||
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
|
|
@ -597,7 +597,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.17.0",
|
||||
"hashbrown 0.17.1",
|
||||
"serde",
|
||||
"serde_core",
|
||||
]
|
||||
|
|
@ -616,9 +616,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.97"
|
||||
version = "0.3.98"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf"
|
||||
checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"futures-util",
|
||||
|
|
@ -1224,9 +1224,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.52.2"
|
||||
version = "1.52.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "110a78583f19d5cdb2c5ccf321d1290344e71313c6c37d43520d386027d18386"
|
||||
checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"libc",
|
||||
|
|
@ -1300,9 +1300,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tower-http"
|
||||
version = "0.6.9"
|
||||
version = "0.6.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a28f0d049ccfaa566e14e9663d304d8577427b368cb4710a20528690287a738b"
|
||||
checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"bytes",
|
||||
|
|
@ -1436,9 +1436,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.120"
|
||||
version = "0.2.121"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1"
|
||||
checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
|
|
@ -1449,9 +1449,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.70"
|
||||
version = "0.4.71"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084"
|
||||
checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
|
|
@ -1459,9 +1459,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.120"
|
||||
version = "0.2.121"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103"
|
||||
checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
|
|
@ -1469,9 +1469,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.120"
|
||||
version = "0.2.121"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41"
|
||||
checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"proc-macro2",
|
||||
|
|
@ -1482,9 +1482,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.120"
|
||||
version = "0.2.121"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea"
|
||||
checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
|
@ -1538,9 +1538,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.97"
|
||||
version = "0.3.98"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eadbac71025cd7b0834f20d1fe8472e8495821b4e9801eb0a60bd1f19827602"
|
||||
checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
|
|
@ -1788,9 +1788,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zerofrom"
|
||||
version = "0.1.7"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df"
|
||||
checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
|
||||
dependencies = [
|
||||
"zerofrom-derive",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ serde_json = "1.0.149"
|
|||
thiserror = "2.0.18"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.52.2", features = ["full"] }
|
||||
tokio = { version = "1.52.3", features = ["full"] }
|
||||
|
|
|
|||
|
|
@ -90,3 +90,12 @@ To run some of the tests in the `tests` directory, first replace the values for
|
|||
```bash
|
||||
cargo test
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
You can run an example from the `examples` directory by first changing into the directory then running `cargo run`. For example:
|
||||
|
||||
```bash
|
||||
cd examples/status-show
|
||||
cargo run
|
||||
```
|
||||
2
docs/.env.example
Normal file
2
docs/.env.example
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
NEXT_TELEMETRY_DISABLED=1
|
||||
DO_NOT_TRACK=1
|
||||
|
|
@ -7,11 +7,11 @@ _openapi:
|
|||
structuredData:
|
||||
headings: []
|
||||
contents:
|
||||
- content: This endpoint lists CKAN resources.
|
||||
- content: Return a list of the name of the site's datasets (packages).
|
||||
---
|
||||
|
||||
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
|
||||
|
||||
This endpoint lists CKAN resources.
|
||||
Return a list of the name of the site's datasets (packages).
|
||||
|
||||
<APIPage document={"./lib/openapi.yml"} operations={[{"path":"package_list","method":"post"}]} />
|
||||
|
|
@ -30,7 +30,7 @@ paths:
|
|||
post:
|
||||
operationId: package_list
|
||||
summary: package_list
|
||||
description: This endpoint lists CKAN resources.
|
||||
description: Return a list of the name of the site's datasets (packages).
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
|
|
|
|||
2
examples/package-list/.gitignore
vendored
Normal file
2
examples/package-list/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.env
|
||||
target/
|
||||
1862
examples/package-list/Cargo.lock
generated
Normal file
1862
examples/package-list/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
8
examples/package-list/Cargo.toml
Normal file
8
examples/package-list/Cargo.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "package-list"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ckanaction = "0.2.0"
|
||||
tokio = { version = "1.52.2", features = ["full"] }
|
||||
8
examples/package-list/README.md
Normal file
8
examples/package-list/README.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Example of using ckanaction to run the /package_list API endpoint
|
||||
|
||||
## Usage
|
||||
the following command to run the `/package_list` CKAN Action API endpoint on `http://localhost:5000` and print the formatted debug output.
|
||||
|
||||
```bash
|
||||
cargo run
|
||||
```
|
||||
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(())
|
||||
}
|
||||
668
examples/status-show/Cargo.lock
generated
668
examples/status-show/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -4,5 +4,5 @@ version = "0.1.0"
|
|||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
ckanaction = "0.1.3"
|
||||
tokio = { version = "1.49.0", features = ["full"] }
|
||||
ckanaction = "0.2.0"
|
||||
tokio = { version = "1.52.2", features = ["full"] }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue