Files
mytheclipse/crates/mytheclipse-storage
asepharyana 19941156b4 fix(ci): gate event crate doctest behind mem feature and apply rustfmt
The crate-root doctest used InMemoryEventBus/TypedEventBus (gated behind
the 'mem' feature), so `cargo test -p mytheclipse-event --no-default-features
--features amqp|nats` failed to compile the doctest (E0432). The example is
now no_run with the mem-dependent imports inside a #[cfg(feature="mem")]
main, so it compiles (and runs) when mem is on and degrades to an empty main
when off.

Also apply rustfmt to mytheclipse-config/dynamic.rs and
mytheclipse-storage/{gcs,s3}.rs to satisfy cargo fmt --all --check.
2026-08-28 22:41:06 +07:00
..
2026-08-28 15:30:52 +00:00

mytheclipse-storage

A unified storage & file system abstraction so file handling isn't locked to one physical location.

  • Local disk (default) — plain files under a root directory.
  • S3-compatible object storage (s3) — Amazon S3, and any S3-compatible endpoint (MinIO included) via a custom endpoint URL.
  • Google Cloud Storage (gcs).

All operations are stream-based, so uploading/downloading a huge object never requires holding it entirely in memory.

Usage

use mytheclipse_storage::{LocalFileStorage, StorageDriver, bytes_stream, read_to_vec};

let storage = LocalFileStorage::new("/var/data");
storage.put("uploads/report.csv", bytes_stream(data)).await?;
let bytes = read_to_vec(storage.get("uploads/report.csv").await?).await?;

Swap LocalFileStorage::new(path) for S3Storage::connect("bucket").await? or GcsStorage::connect("bucket").await? to move to a distributed backend without touching call sites.