Crates.io | crypto-auditing |
lib.rs | crypto-auditing |
version | 0.2.3 |
source | src |
created_at | 2023-09-15 07:37:08.825017 |
updated_at | 2024-09-10 02:00:12.18011 |
description | Client library for crypto-auditing project |
homepage | |
repository | |
max_upload_size | |
id | 973528 |
size | 88,346 |
This crate provides a library interface to interact with the crypto-auditing event broker. To see the whole architecture, see the design document.
To use in your project, add into your Cargo.toml
:
[dependencies]
crypto-auditing = "0.2"
The following example connects to the event broker and receives events prefixed with "tls::".
use crypto_auditing::event_broker::Client;
use futures::stream::StreamExt;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = Client::new().scopes(&vec!["tls".to_string()]);
let (_handle, mut reader) = client.start().await?;
tokio::spawn(async move {
while let Some(event) = reader.next().await {
println!("{:?}", &event);
}
});
tokio::signal::ctrl_c().await?;
Ok(())
}