ferro-storage
File storage abstraction for the Ferro framework.
Features
- Local filesystem driver
- In-memory driver (for testing)
- Amazon S3 driver (with
s3feature) - Unified API across all backends
Usage
use ;
// Create storage with configuration
let storage = with_config;
// Store a file
storage.put.await?;
// Get a file
let contents = storage.get.await?;
// Check existence
if storage.exists.await?
// Get public URL
let url = storage.disk?.url.await?;
// Delete a file
storage.delete.await?;
Multiple Disks
// Configure multiple disks
let storage = with_config;
// Use specific disk
let s3 = storage.disk?;
s3.put.await?;
S3 Support
Enable the s3 feature:
[]
= { = "0.1", = ["s3"] }
License
MIT