use klauthed_core::config::StorageConfig;
use klauthed_data::storage;
use object_store::ObjectStoreExt;
use object_store::path::Path as ObjectPath;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = StorageConfig::Local { root: std::env::temp_dir().join("klauthed-example-store") };
let store = storage::connect(&config).await?;
let path = ObjectPath::from("notes/hello.txt");
store.put(&path, "hello from klauthed".into()).await?;
let bytes = store.get(&path).await?.bytes().await?;
println!("stored at : {path}");
println!("read back : {}", String::from_utf8_lossy(&bytes));
store.delete(&path).await?;
println!("deleted : {path}");
Ok(())
}