crypsol_storage 0.2.0

Multi-cloud storage library for Rust with image processing, validation, and thumbnail generation. Supports AWS S3, GCS, Azure Blob, Cloudflare R2, MinIO, and local filesystem.
Documentation
/// Configuration for the [`StorageService`](crate::StorageService).
#[derive(Debug, Clone)]
pub struct StorageConfig {
    /// Maximum upload file size in bytes (default: 5 MB).
    pub max_file_size: usize,
    /// Maximum download size in bytes (default: 100 MB).
    pub max_download_size: u64,
    /// Maximum decoded image allocation in bytes (default: 50 MB).
    pub max_image_alloc: u64,
    /// Maximum decoded image dimension per side in pixels (default: 10 000).
    pub max_image_dimension: u32,
    /// Default `Cache-Control` header for uploads (default: 1 year).
    pub default_cache_control: String,
}

impl Default for StorageConfig {
    fn default() -> Self {
        Self {
            max_file_size: 5 * 1024 * 1024,
            max_download_size: 100 * 1024 * 1024,
            max_image_alloc: 50 * 1024 * 1024,
            max_image_dimension: 10_000,
            default_cache_control: "max-age=31536000".to_string(),
        }
    }
}