MCPcopy Create free account
hub / github.com/cosdata/cosdata / main

Function main

org/src/s3_client.rs:225–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223}
224
225fn main() -> Result<(), Box<dyn Error>> {
226 // Initialize client
227 let s3_client = S3Client::new(
228 "AKIA2CUNLIWONNM4DO66".to_string(),
229 "---FILL HERE---".to_string(),
230 "eu-north-1".to_string(),
231 "cosdata-channi--eun1-az2--x-s3".to_string(),
232 )?;
233
234 // Upload example
235 let upload_key = s3_client.upload_file("local_file.txt", "uploads")?;
236
237 // List objects
238 let objects = s3_client.list_objects("uploads/")?;
239 println!("Objects in bucket:");
240 for obj in objects {
241 println!("- {}", obj);
242 }
243
244 // Download example
245 s3_client.download_file(&upload_key, "downloaded_file.txt")?;
246
247 // Delete example
248 //s3_client.delete_object(&upload_key)?;
249
250 Ok(())
251}

Callers

nothing calls this directly

Calls 3

upload_fileMethod · 0.80
list_objectsMethod · 0.80
download_fileMethod · 0.80

Tested by

no test coverage detected