()
| 223 | } |
| 224 | |
| 225 | fn 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 | } |
nothing calls this directly
no test coverage detected