Crates.io | edc-connector-client |
lib.rs | edc-connector-client |
version | |
source | src |
created_at | 2024-05-08 19:59:27.368658 |
updated_at | 2024-12-04 17:45:13.901788 |
description | A Rust client for EDC |
homepage | |
repository | https://github.com/wolf4ood/edc-rs |
max_upload_size | |
id | 1234324 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A Rust client for EDC.
Install from crates.io
[dependencies]
edc-connector-client = "0.1"
Fetching an asset with id 1
and reading the description
property as string.
use edc_connector_client::{Auth, EdcConnectorClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = EdcConnectorClient::builder()
.management_url("http://myedc")
.with_auth(Auth::api_token("password"))
.build()?;
let asset = client.assets().get("1").await?;
println!("Got {:?}", asset);
println!(
"Property description: {:?}",
asset.property::<String>("description").unwrap()
);
Ok(())
}
git clone https://github.com/wolf4ood/edc-rs.git
cd edc-rs
cargo build
Some tests run against a running instance of EDC.
You can use docker compose to start an instance for testing.
docker compose -f testing/docker-compose.yml up -d
cargo test