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
//! # Crypsol Storage
//!
//! Multi-cloud storage library for Rust with image processing, validation,
//! and thumbnail generation.
//!
//! ## Backends
//!
//! | Feature | Backend | Presigned URLs |
//! |---------|---------|----------------|
//! | `s3` *(default)* | AWS S3, Cloudflare R2, MinIO | Yes |
//! | `gcs` | Google Cloud Storage | No |
//! | `azure` | Azure Blob Storage | No |
//! | `local` | Local filesystem (dev/testing) | No |
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use crypsol_storage::{S3Backend, StorageConfig, StorageService, ImageUploadConfig};
//!
//! # async fn run() -> Result<(), crypsol_storage::Error> {
//! let backend = S3Backend::builder()
//!     .region("us-east-1")
//!     .bucket("my-bucket")
//!     .credentials("AKID...", "secret...")
//!     .build()?;
//!
//! let service = StorageService::new(backend, StorageConfig::default());
//!
//! // Upload an image with automatic thumbnail generation
//! let config = ImageUploadConfig::default();
//! # let image_bytes: Vec<u8> = vec![];
//! let result = service
//!     .upload_image_with_config(&image_bytes, "image/jpeg", &config)
//!     .await?;
//!
//! println!("Image:     {}", result.url);
//! println!("Thumbnail: {}", result.thumbnail_url);
//! # Ok(())
//! # }
//! ```
//!
//! See the [README](https://github.com/crypsol/crypsol_storage) for full
//! examples covering every backend and API method.

mod config;
mod error;
mod img;
mod service;
mod traits;
mod types;

pub mod backends;

pub use config::StorageConfig;
pub use error::Error;
pub use service::StorageService;
pub use traits::StorageBackend;
pub use types::{
    ALLOWED_IMAGE_TYPES, DownloadResult, FileUploadResult, ImageUploadConfig,
    MAX_PRESIGN_EXPIRY_SECS, PROFILE_IMAGE_SIZE, PresignedUploadResult, PutOptions,
    RawDownloadResult, THUMBNAIL_SIZE, UploadResult, generate_storage_key, generate_thumbnail_key,
    validate_content_type, validate_expiry, validate_file_size,
};

#[cfg(feature = "s3")]
pub use backends::s3::{S3Backend, S3BackendBuilder};

#[cfg(feature = "gcs")]
pub use backends::gcs::{GcsBackend, GcsBackendBuilder, GcsCredentials};

#[cfg(feature = "azure")]
pub use backends::azure::{AzureBackend, AzureBackendBuilder};

#[cfg(feature = "local")]
pub use backends::local::LocalBackend;