1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! File storage abstraction and implementations
//!
//! This module provides a trait-based abstraction for file storage with multiple backends:
//! - Local filesystem storage (for development and small deployments)
//! - S3-compatible storage (AWS S3, MinIO, etc.) - planned for Week 8
//! - Azure Blob Storage - planned for Week 8
//!
//! # Architecture
//!
//! The `FileStorage` trait provides a consistent API for storing, retrieving, and managing files
//! regardless of the underlying storage backend. This allows applications to:
//! - Switch storage backends without changing handler code
//! - Test with local storage and deploy with S3
//! - Support multiple storage backends simultaneously
//!
//! # Examples
//!
//! ```rust,no_run
//! use acton_htmx::storage::{FileStorage, LocalFileStorage, UploadedFile, StoredFile};
//! use std::path::PathBuf;
//!
//! # async fn example() -> anyhow::Result<()> {
//! // Create local storage backend
//! let storage = LocalFileStorage::new(PathBuf::from("/var/uploads"))?;
//!
//! // Store a file
//! let uploaded = UploadedFile {
//! filename: "avatar.png".to_string(),
//! content_type: "image/png".to_string(),
//! data: vec![/* ... */],
//! };
//!
//! let stored = storage.store(uploaded).await?;
//! println!("Stored file: {}", stored.id);
//!
//! // Retrieve the file
//! let data = storage.retrieve(&stored.id).await?;
//!
//! // Delete the file
//! storage.delete(&stored.id).await?;
//! # Ok(())
//! # }
//! ```
pub use LocalFileStorage;
pub use ;
pub use ImageProcessor;
pub use ;
pub use ClamAvConnection;
pub use FileStorage;
pub use ;
pub use MimeValidator;