Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4027d3eb17 | ||
|
|
5f1e3ace5c | ||
|
|
0f2b776bb8 | ||
|
|
5717f8aaaa | ||
|
|
52d9e1e93e | ||
|
|
19941156b4 | ||
|
|
b2d3f32d83 | ||
|
|
4d851c5a58 | ||
|
|
db4f277336 |
+28
-28
@@ -60,33 +60,33 @@ jobs:
|
||||
flags: "-p mytheclipse --no-default-features --features lifecycle"
|
||||
- name: mytheclipse / observability only
|
||||
flags: "-p mytheclipse --no-default-features --features observability"
|
||||
# corex-cache
|
||||
- name: corex-cache / default
|
||||
flags: "-p corex-cache"
|
||||
- name: corex-cache / l1-moka
|
||||
flags: "-p corex-cache --no-default-features --features l1-moka"
|
||||
- name: corex-cache / l2-redis
|
||||
flags: "-p corex-cache --no-default-features --features l1-memory,l2-redis"
|
||||
# corex-storage
|
||||
- name: corex-storage / default (local)
|
||||
flags: "-p corex-storage"
|
||||
- name: corex-storage / s3
|
||||
flags: "-p corex-storage --no-default-features --features s3"
|
||||
- name: corex-storage / gcs
|
||||
flags: "-p corex-storage --no-default-features --features gcs"
|
||||
# corex-event
|
||||
- name: corex-event / default (mem)
|
||||
flags: "-p corex-event"
|
||||
- name: corex-event / amqp
|
||||
flags: "-p corex-event --no-default-features --features amqp"
|
||||
- name: corex-event / nats
|
||||
flags: "-p corex-event --no-default-features --features nats"
|
||||
# corex-config
|
||||
- name: corex-config / default
|
||||
flags: "-p corex-config"
|
||||
# corex-crypto
|
||||
- name: corex-crypto / default
|
||||
flags: "-p corex-crypto"
|
||||
# mytheclipse-cache
|
||||
- name: mytheclipse-cache / default
|
||||
flags: "-p mytheclipse-cache"
|
||||
- name: mytheclipse-cache / l1-moka
|
||||
flags: "-p mytheclipse-cache --no-default-features --features l1-moka"
|
||||
- name: mytheclipse-cache / l2-redis
|
||||
flags: "-p mytheclipse-cache --no-default-features --features l1-memory,l2-redis"
|
||||
# mytheclipse-storage
|
||||
- name: mytheclipse-storage / default (local)
|
||||
flags: "-p mytheclipse-storage"
|
||||
- name: mytheclipse-storage / s3
|
||||
flags: "-p mytheclipse-storage --no-default-features --features s3"
|
||||
- name: mytheclipse-storage / gcs
|
||||
flags: "-p mytheclipse-storage --no-default-features --features gcs"
|
||||
# mytheclipse-event
|
||||
- name: mytheclipse-event / default (mem)
|
||||
flags: "-p mytheclipse-event"
|
||||
- name: mytheclipse-event / amqp
|
||||
flags: "-p mytheclipse-event --no-default-features --features amqp"
|
||||
- name: mytheclipse-event / nats
|
||||
flags: "-p mytheclipse-event --no-default-features --features nats"
|
||||
# mytheclipse-config
|
||||
- name: mytheclipse-config / default
|
||||
flags: "-p mytheclipse-config"
|
||||
# mytheclipse-crypto
|
||||
- name: mytheclipse-crypto / default
|
||||
flags: "-p mytheclipse-crypto"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
crate:
|
||||
[mytheclipse, corex-cache, corex-storage, corex-event, corex-config, corex-crypto]
|
||||
[mytheclipse, mytheclipse-cache, mytheclipse-storage, mytheclipse-event, mytheclipse-config, mytheclipse-crypto]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
# between publishes avoids hitting crates.io's rate limit.
|
||||
- name: Publish workspace crates
|
||||
run: |
|
||||
for crate in mytheclipse corex-cache corex-storage corex-event corex-config corex-crypto; do
|
||||
for crate in mytheclipse mytheclipse-cache mytheclipse-storage mytheclipse-event mytheclipse-config mytheclipse-crypto; do
|
||||
echo "Publishing $crate..."
|
||||
cargo publish -p "$crate" --allow-dirty --no-verify
|
||||
sleep 15
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
## [1.3.3](https://github.com/asepharyana/mytheclipse/compare/v1.3.2...v1.3.3) (2026-08-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **publish:** trim mytheclipse keywords to 5 to satisfy crates.io limit ([5f1e3ac](https://github.com/asepharyana/mytheclipse/commit/5f1e3ace5c8cb10881e30f550f51b7d845b24edd))
|
||||
|
||||
## [1.3.2](https://github.com/asepharyana/mytheclipse/compare/v1.3.1...v1.3.2) (2026-08-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** gate cache & storage crate doctests behind their features ([5717f8a](https://github.com/asepharyana/mytheclipse/commit/5717f8aaaae34cb66cdbfc31f4982c93816ee5a3))
|
||||
|
||||
## [1.3.1](https://github.com/asepharyana/mytheclipse/compare/v1.3.0...v1.3.1) (2026-08-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** gate event crate doctest behind mem feature and apply rustfmt ([1994115](https://github.com/asepharyana/mytheclipse/commit/19941156b43ec58370d0d1369174ec84400e9bc9))
|
||||
|
||||
# [1.3.0](https://github.com/asepharyana/mytheclipse/compare/v1.2.0...v1.3.0) (2026-08-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add corex-storage crate for unified storage abstraction ([db4f277](https://github.com/asepharyana/mytheclipse/commit/db4f277336d1e32cb6a2ddd86ac37ae9789fa4f8))
|
||||
|
||||
# [1.2.0](https://github.com/asepharyana/mytheclipse/compare/v1.1.0...v1.2.0) (2026-08-28)
|
||||
|
||||
|
||||
|
||||
Generated
+4471
-15
File diff suppressed because it is too large
Load Diff
+10
-45
@@ -1,45 +1,10 @@
|
||||
[package]
|
||||
name = "mytheclipse"
|
||||
version = "1.1.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/asepharyana/mytheclipse"
|
||||
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||
documentation = "https://docs.rs/mytheclipse"
|
||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||
description = "Resource-aware abstractions for async I/O, heavy compute, background queue management, resiliency, traffic control, lifecycle, and observability."
|
||||
readme = "README.md"
|
||||
keywords = ["async", "concurrency", "rayon", "tokio", "resource-management", "resiliency", "retry", "circuit-breaker", "rate-limit", "observability", "cron", "shutdown"]
|
||||
categories = ["asynchronous", "concurrency", "rust-patterns"]
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.53", features = ["full"], optional = true }
|
||||
rayon = { version = "1.12", optional = true }
|
||||
rand = { version = "0.8", optional = true }
|
||||
num_cpus = "1.17"
|
||||
tracing = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.53", features = ["full"] }
|
||||
tracing-subscriber = "0.3"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
io = ["dep:tokio"]
|
||||
compute = ["dep:rayon"]
|
||||
bg = ["dep:tokio"]
|
||||
resiliency = ["dep:tokio", "dep:rand"]
|
||||
traffic = ["dep:tokio"]
|
||||
lifecycle = ["dep:tokio"]
|
||||
observability = ["dep:tokio"]
|
||||
full = ["io", "compute", "bg", "resiliency", "traffic", "lifecycle", "observability"]
|
||||
|
||||
[[example]]
|
||||
name = "main"
|
||||
path = "examples/main.rs"
|
||||
required-features = ["full"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
[workspace]
|
||||
members = [
|
||||
"crates/mytheclipse",
|
||||
"crates/mytheclipse-cache",
|
||||
"crates/mytheclipse-storage",
|
||||
"crates/mytheclipse-event",
|
||||
"crates/mytheclipse-config",
|
||||
"crates/mytheclipse-crypto",
|
||||
]
|
||||
resolver = "2"
|
||||
@@ -12,11 +12,11 @@ concern.
|
||||
| Crate | Description | Docs |
|
||||
| :--- | :--- | :--- |
|
||||
| [`mytheclipse`](crates/mytheclipse) | Resource-aware execution primitives (async I/O, compute, background queues), resiliency (retry, circuit breaker, timeout), traffic control (rate limiter, backpressure, concurrency limiter), lifecycle (graceful shutdown, cron), and observability (metrics, panic tracking). | [README](crates/mytheclipse/README.md) |
|
||||
| [`corex-cache`](crates/corex-cache) | Unified multi-layer (L1/L2) cache abstraction: in-memory or Moka L1, Redis/Valkey L2, cache-aside read-through. | [README](crates/corex-cache/README.md) |
|
||||
| [`corex-storage`](crates/corex-storage) | Unified storage & file system abstraction: one driver interface over local disk, S3/MinIO, and Google Cloud Storage, stream-based. | [README](crates/corex-storage/README.md) |
|
||||
| [`corex-event`](crates/corex-event) | Unified events & message bus abstraction: in-memory pub/sub dispatcher plus RabbitMQ and NATS broker adapters behind one trait. | [README](crates/corex-event/README.md) |
|
||||
| [`corex-config`](crates/corex-config) | Type-safe, dynamic configuration engine: load `.env`/YAML/JSON/TOML into typed structs, with hot-reload. | [README](crates/corex-config/README.md) |
|
||||
| [`corex-crypto`](crates/corex-crypto) | Safe hashing (Argon2id), encryption (AES-256-GCM), and JWT tokens, with key rotation support. | [README](crates/corex-crypto/README.md) |
|
||||
| [`mytheclipse-cache`](crates/mytheclipse-cache) | Unified multi-layer (L1/L2) cache abstraction: in-memory or Moka L1, Redis/Valkey L2, cache-aside read-through. | [README](crates/mytheclipse-cache/README.md) |
|
||||
| [`mytheclipse-storage`](crates/mytheclipse-storage) | Unified storage & file system abstraction: one driver interface over local disk, S3/MinIO, and Google Cloud Storage, stream-based. | [README](crates/mytheclipse-storage/README.md) |
|
||||
| [`mytheclipse-event`](crates/mytheclipse-event) | Unified events & message bus abstraction: in-memory pub/sub dispatcher plus RabbitMQ and NATS broker adapters behind one trait. | [README](crates/mytheclipse-event/README.md) |
|
||||
| [`mytheclipse-config`](crates/mytheclipse-config) | Type-safe, dynamic configuration engine: load `.env`/YAML/JSON/TOML into typed structs, with hot-reload. | [README](crates/mytheclipse-config/README.md) |
|
||||
| [`mytheclipse-crypto`](crates/mytheclipse-crypto) | Safe hashing (Argon2id), encryption (AES-256-GCM), and JWT tokens, with key rotation support. | [README](crates/mytheclipse-crypto/README.md) |
|
||||
|
||||
Every crate follows the same philosophy: **one small interface, pluggable
|
||||
backends behind feature flags, and a working default that needs no external
|
||||
@@ -31,11 +31,11 @@ Each crate is published independently; add the ones you need:
|
||||
```toml
|
||||
[dependencies]
|
||||
mytheclipse = { version = "1", features = ["full"] }
|
||||
corex-cache = "0.1"
|
||||
corex-storage = { version = "0.1", features = ["s3"] }
|
||||
corex-event = { version = "0.1", features = ["nats"] }
|
||||
corex-config = "0.1"
|
||||
corex-crypto = "0.1"
|
||||
mytheclipse-cache = "0.1"
|
||||
mytheclipse-storage = { version = "0.1", features = ["s3"] }
|
||||
mytheclipse-event = { version = "0.1", features = ["nats"] }
|
||||
mytheclipse-config = "0.1"
|
||||
mytheclipse-crypto = "0.1"
|
||||
```
|
||||
|
||||
See each crate's own README (linked above) for usage examples and the full
|
||||
@@ -52,7 +52,7 @@ cargo clippy --workspace --all-features -- -D warnings
|
||||
cargo fmt --all --check
|
||||
```
|
||||
|
||||
Or target a single crate with `-p <name>`, e.g. `cargo test -p corex-cache`.
|
||||
Or target a single crate with `-p <name>`, e.g. `cargo test -p mytheclipse-cache`.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "corex-cache"
|
||||
version = "1.2.0"
|
||||
name = "mytheclipse-cache"
|
||||
version = "1.3.3"
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/asepharyana/mytheclipse"
|
||||
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||
documentation = "https://docs.rs/corex-cache"
|
||||
documentation = "https://docs.rs/mytheclipse-cache"
|
||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||
description = "Unified multi-layer cache abstraction: L1/L2 caching, cache-aside and auto-refresh, with pluggable backends."
|
||||
readme = "README.md"
|
||||
@@ -1,4 +1,4 @@
|
||||
# corex-cache
|
||||
# mytheclipse-cache
|
||||
|
||||
A unified multi-layer cache abstraction so your app isn't locked to one cache
|
||||
provider. Combines an in-process **L1** cache with a distributed **L2** cache
|
||||
@@ -15,7 +15,7 @@ provider. Combines an in-process **L1** cache with a distributed **L2** cache
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use corex_cache::{Cache, MemoryCache, MultiLayerCache, CacheAside};
|
||||
use mytheclipse_cache::{Cache, MemoryCache, MultiLayerCache, CacheAside};
|
||||
|
||||
let cache = MultiLayerCache::new(
|
||||
MemoryCache::new(), // L1
|
||||
@@ -1,4 +1,4 @@
|
||||
//! # corex-cache
|
||||
//! # mytheclipse-cache
|
||||
//!
|
||||
//! A unified multi-layer cache abstraction that keeps your application from
|
||||
//! being locked to any single cache provider.
|
||||
@@ -17,9 +17,12 @@
|
||||
//!
|
||||
//! ## Example
|
||||
//!
|
||||
//! Multi-layer + cache-aside composition (default features):
|
||||
//!
|
||||
//! ```no_run
|
||||
//! use corex_cache::{Cache, MemoryCache, MultiLayerCache, CacheAside};
|
||||
//! # #[cfg(all(feature = "l1-memory", feature = "cache-aside"))]
|
||||
//! # async fn run() {
|
||||
//! use mytheclipse_cache::{Cache, MemoryCache, MultiLayerCache, CacheAside};
|
||||
//! let l1 = MemoryCache::new();
|
||||
//! let l2 = MemoryCache::new(); // in a real app: a RedisCache
|
||||
//! let cache = MultiLayerCache::new(l1, l2);
|
||||
@@ -34,6 +37,8 @@
|
||||
//! );
|
||||
//! let _v = aside.get("orders:42").await.unwrap();
|
||||
//! # }
|
||||
//! # #[cfg(not(all(feature = "l1-memory", feature = "cache-aside")))]
|
||||
//! # fn run() {}
|
||||
//! ```
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
@@ -101,7 +101,7 @@ mod tests {
|
||||
|
||||
/// Integration test requiring a live Redis at `REDIS_URL`
|
||||
/// (e.g. `redis://127.0.0.1:6379`). Run with:
|
||||
/// `REDIS_URL=redis://127.0.0.1:6379 cargo test -p corex-cache --features l2-redis -- --ignored` .
|
||||
/// `REDIS_URL=redis://127.0.0.1:6379 cargo test -p mytheclipse-cache --features l2-redis -- --ignored` .
|
||||
#[tokio::test]
|
||||
#[ignore = "requires a live Redis instance (REDIS_URL)"]
|
||||
async fn set_get_roundtrip_live() {
|
||||
@@ -111,7 +111,7 @@ mod tests {
|
||||
.get_multiplexed_tokio_connection()
|
||||
.await
|
||||
.expect("connect");
|
||||
let cache = RedisCache::with_prefix(conn, "corex_cache_test:".to_string());
|
||||
let cache = RedisCache::with_prefix(conn, "mytheclipse_cache_test:".to_string());
|
||||
|
||||
cache
|
||||
.set("k", b"v".to_vec(), Some(Duration::from_secs(3600)))
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "corex-config"
|
||||
version = "1.2.0"
|
||||
name = "mytheclipse-config"
|
||||
version = "1.3.3"
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/asepharyana/mytheclipse"
|
||||
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||
documentation = "https://docs.rs/corex-config"
|
||||
documentation = "https://docs.rs/mytheclipse-config"
|
||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||
description = "Type-safe, dynamic configuration engine: load .env/YAML/JSON/TOML into typed structs with hot-reload and validation."
|
||||
readme = "README.md"
|
||||
@@ -1,4 +1,4 @@
|
||||
# corex-config
|
||||
# mytheclipse-config
|
||||
|
||||
Type-safe, dynamic configuration: load `.env`, YAML, JSON, or TOML directly
|
||||
into a typed Rust struct, merge multiple sources with environment variables
|
||||
@@ -14,7 +14,7 @@ taking priority, and optionally hot-reload when the source files change.
|
||||
|
||||
```rust
|
||||
use serde::Deserialize;
|
||||
use corex_config::ConfigLoader;
|
||||
use mytheclipse_config::ConfigLoader;
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
struct AppConfig {
|
||||
@@ -31,13 +31,13 @@ let config: AppConfig = ConfigLoader::new()
|
||||
### Hot-reload
|
||||
|
||||
```rust
|
||||
use corex_config::DynamicConfig;
|
||||
use mytheclipse_config::DynamicConfig;
|
||||
# use serde::Deserialize;
|
||||
# #[derive(Debug, Deserialize, Clone)] struct AppConfig { port: u16 }
|
||||
|
||||
let cfg = DynamicConfig::<AppConfig>::watch_files(
|
||||
vec!["config.yaml".into()],
|
||||
|| corex_config::ConfigLoader::new().merge_file("config.yaml".as_ref())?.build(),
|
||||
|| mytheclipse_config::ConfigLoader::new().merge_file("config.yaml".as_ref())?.build(),
|
||||
)?;
|
||||
|
||||
let mut changes = cfg.subscribe();
|
||||
@@ -43,13 +43,16 @@ impl<T: Config + Clone> DynamicConfig<T> {
|
||||
pub fn get(&self) -> T {
|
||||
self.inner
|
||||
.read()
|
||||
.expect("corex-config: RwLock poisoned")
|
||||
.expect("mytheclipse-config: RwLock poisoned")
|
||||
.clone()
|
||||
}
|
||||
|
||||
/// Replaces the current value and notifies subscribers.
|
||||
pub fn set(&self, new: T) {
|
||||
*self.inner.write().expect("corex-config: RwLock poisoned") = new;
|
||||
*self
|
||||
.inner
|
||||
.write()
|
||||
.expect("mytheclipse-config: RwLock poisoned") = new;
|
||||
let _ = self.tx.send(());
|
||||
}
|
||||
|
||||
@@ -101,7 +104,7 @@ impl<T: Config + Clone> DynamicConfig<T> {
|
||||
}
|
||||
|
||||
std::thread::Builder::new()
|
||||
.name("corex-config-watch".into())
|
||||
.name("mytheclipse-config-watch".into())
|
||||
.spawn(move || {
|
||||
// Keep the watcher alive for the life of this thread.
|
||||
let _watcher = watcher;
|
||||
@@ -115,12 +118,12 @@ impl<T: Config + Clone> DynamicConfig<T> {
|
||||
}
|
||||
match reload() {
|
||||
Ok(new) => {
|
||||
*inner.write().expect("corex-config: RwLock poisoned") = new;
|
||||
*inner.write().expect("mytheclipse-config: RwLock poisoned") = new;
|
||||
let _ = tx.send(());
|
||||
last_applied = Instant::now();
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!("corex-config: hot-reload failed: {e}");
|
||||
tracing::error!("mytheclipse-config: hot-reload failed: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Shared error type for corex-config.
|
||||
//! Shared error type for mytheclipse-config.
|
||||
|
||||
/// Errors surfaced while loading or reloading configuration.
|
||||
#[non_exhaustive]
|
||||
@@ -1,4 +1,4 @@
|
||||
//! # corex-config
|
||||
//! # mytheclipse-config
|
||||
//!
|
||||
//! A type-safe, dynamic configuration engine: load environment variables,
|
||||
//! `.env` files, YAML, JSON, or TOML directly into a typed Rust struct, with
|
||||
@@ -14,7 +14,7 @@
|
||||
//!
|
||||
//! ```no_run
|
||||
//! use serde::Deserialize;
|
||||
//! use corex_config::ConfigLoader;
|
||||
//! use mytheclipse_config::ConfigLoader;
|
||||
//!
|
||||
//! #[derive(Debug, Deserialize, Clone)]
|
||||
//! struct AppConfig {
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "corex-crypto"
|
||||
version = "1.2.0"
|
||||
name = "mytheclipse-crypto"
|
||||
version = "1.3.3"
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/asepharyana/mytheclipse"
|
||||
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||
documentation = "https://docs.rs/corex-crypto"
|
||||
documentation = "https://docs.rs/mytheclipse-crypto"
|
||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||
description = "Safe hashing, encryption, and token helpers (Argon2id, AES-256-GCM, JWT/Paseto) with key rotation support."
|
||||
readme = "README.md"
|
||||
@@ -1,4 +1,4 @@
|
||||
# corex-crypto
|
||||
# mytheclipse-crypto
|
||||
|
||||
Safe, one-line security helpers that are easy to get wrong when hand-rolled:
|
||||
|
||||
@@ -20,7 +20,7 @@ independent.
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use corex_crypto::{PasswordHasher, Encryptor, TokenSigner};
|
||||
use mytheclipse_crypto::{PasswordHasher, Encryptor, TokenSigner};
|
||||
|
||||
let hasher = PasswordHasher::new();
|
||||
let hash = hasher.hash("letmein").unwrap();
|
||||
@@ -1,4 +1,4 @@
|
||||
//! # corex-crypto
|
||||
//! # mytheclipse-crypto
|
||||
//!
|
||||
//! Low-level security helpers that are easy to get wrong when hand-rolled:
|
||||
//!
|
||||
@@ -18,7 +18,7 @@
|
||||
//! ## Example
|
||||
//!
|
||||
//! ```no_run
|
||||
//! use corex_crypto::{PasswordHasher, Encryptor, TokenSigner};
|
||||
//! use mytheclipse_crypto::{PasswordHasher, Encryptor, TokenSigner};
|
||||
//!
|
||||
//! // Hash & verify a password.
|
||||
//! let hasher = PasswordHasher::new();
|
||||
@@ -63,7 +63,7 @@ pub use token::{Claims, TokenError, TokenSigner};
|
||||
|
||||
pub use key_ring::KeyRing;
|
||||
|
||||
/// Errors returned across corex-crypto primitives.
|
||||
/// Errors returned across mytheclipse-crypto primitives.
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug)]
|
||||
pub enum CryptoError {
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "corex-event"
|
||||
version = "1.2.0"
|
||||
name = "mytheclipse-event"
|
||||
version = "1.3.3"
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/asepharyana/mytheclipse"
|
||||
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||
documentation = "https://docs.rs/corex-event"
|
||||
documentation = "https://docs.rs/mytheclipse-event"
|
||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||
description = "Unified events & message bus abstraction: in-memory pub/sub dispatcher plus pluggable distributed broker backends (RabbitMQ, NATS)."
|
||||
readme = "README.md"
|
||||
@@ -1,4 +1,4 @@
|
||||
# corex-event
|
||||
# mytheclipse-event
|
||||
|
||||
A unified events & message bus abstraction so component-to-component (or
|
||||
service-to-service) communication isn't locked to one transport.
|
||||
@@ -19,7 +19,7 @@ service-to-service) communication isn't locked to one transport.
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use corex_event::{InMemoryEventBus, TypedEventBus};
|
||||
use mytheclipse_event::{InMemoryEventBus, TypedEventBus};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
||||
@@ -2,7 +2,7 @@
|
||||
//! AMQP 0.9.1 client.
|
||||
//!
|
||||
//! Topics map to routing keys on a single topic [`lapin::ExchangeKind::Topic`]
|
||||
//! exchange (default name `corex.events`); each subscription declares its own
|
||||
//! exchange (default name `mytheclipse.events`); each subscription declares its own
|
||||
//! exclusive, auto-delete queue bound to that routing key, matching the
|
||||
//! common "fanout via topic exchange" pattern.
|
||||
|
||||
@@ -107,7 +107,7 @@ impl EventBus for AmqpEventBus {
|
||||
.channel
|
||||
.basic_consume(
|
||||
queue.name().as_str(),
|
||||
"corex-event-consumer",
|
||||
"mytheclipse-event-consumer",
|
||||
BasicConsumeOptions::default(),
|
||||
FieldTable::default(),
|
||||
)
|
||||
@@ -145,12 +145,12 @@ mod tests {
|
||||
|
||||
/// Requires a live RabbitMQ at `AMQP_URL` (e.g.
|
||||
/// `amqp://guest:guest@127.0.0.1:5672/%2f`). Run with:
|
||||
/// `AMQP_URL=... cargo test -p corex-event --features amqp -- --ignored`.
|
||||
/// `AMQP_URL=... cargo test -p mytheclipse-event --features amqp -- --ignored`.
|
||||
#[tokio::test]
|
||||
#[ignore = "requires a live RabbitMQ instance (AMQP_URL)"]
|
||||
async fn publish_subscribe_roundtrip_live() {
|
||||
let url = std::env::var("AMQP_URL").expect("set AMQP_URL");
|
||||
let bus = AmqpEventBus::connect(&url, "corex_event_test")
|
||||
let bus = AmqpEventBus::connect(&url, "mytheclipse_event_test")
|
||||
.await
|
||||
.unwrap();
|
||||
let mut sub = bus.subscribe("orders.created").await.unwrap();
|
||||
@@ -1,4 +1,4 @@
|
||||
//! # corex-event
|
||||
//! # mytheclipse-event
|
||||
//!
|
||||
//! A unified events & message bus abstraction so component-to-component (or
|
||||
//! service-to-service) communication doesn't get locked to one transport.
|
||||
@@ -15,20 +15,27 @@
|
||||
//!
|
||||
//! ## Example
|
||||
//!
|
||||
//! ```
|
||||
//! use corex_event::{EventBus, InMemoryEventBus, TypedEventBus};
|
||||
//! The in-memory + typed bus (`mem` feature, on by default):
|
||||
//!
|
||||
//! ```no_run
|
||||
//! use serde::{Deserialize, Serialize};
|
||||
//!
|
||||
//! #[derive(Debug, Serialize, Deserialize, PartialEq)]
|
||||
//! struct OrderCreated { id: u64 }
|
||||
//!
|
||||
//! # #[tokio::main] async fn main() {
|
||||
//! let bus = TypedEventBus::new(InMemoryEventBus::default());
|
||||
//! let mut sub = bus.subscribe::<OrderCreated>("orders").await.unwrap();
|
||||
//! bus.publish("orders", &OrderCreated { id: 42 }).await.unwrap();
|
||||
//! let event = sub.recv().await.unwrap();
|
||||
//! assert_eq!(event, OrderCreated { id: 42 });
|
||||
//! # }
|
||||
//! #[cfg(feature = "mem")]
|
||||
//! #[tokio::main]
|
||||
//! async fn main() {
|
||||
//! use mytheclipse_event::{EventBus, InMemoryEventBus, TypedEventBus};
|
||||
//! let bus = TypedEventBus::new(InMemoryEventBus::default());
|
||||
//! let mut sub = bus.subscribe::<OrderCreated>("orders").await.unwrap();
|
||||
//! bus.publish("orders", &OrderCreated { id: 42 }).await.unwrap();
|
||||
//! let event = sub.recv().await.unwrap();
|
||||
//! assert_eq!(event, OrderCreated { id: 42 });
|
||||
//! }
|
||||
//!
|
||||
//! #[cfg(not(feature = "mem"))]
|
||||
//! fn main() {}
|
||||
//! ```
|
||||
|
||||
pub mod traits;
|
||||
@@ -77,7 +77,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
/// Requires a live NATS server at `NATS_URL` (e.g. `nats://127.0.0.1:4222`).
|
||||
/// Run with: `NATS_URL=... cargo test -p corex-event --features nats -- --ignored`.
|
||||
/// Run with: `NATS_URL=... cargo test -p mytheclipse-event --features nats -- --ignored`.
|
||||
#[tokio::test]
|
||||
#[ignore = "requires a live NATS instance (NATS_URL)"]
|
||||
async fn publish_subscribe_roundtrip_live() {
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "corex-storage"
|
||||
version = "1.2.0"
|
||||
name = "mytheclipse-storage"
|
||||
version = "1.3.3"
|
||||
edition = "2021"
|
||||
rust-version = "1.75"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/asepharyana/mytheclipse"
|
||||
homepage = "https://github.com/asepharyana/mytheclipse"
|
||||
documentation = "https://docs.rs/corex-storage"
|
||||
documentation = "https://docs.rs/mytheclipse-storage"
|
||||
authors = ["asepharyana <superaseph@gmail.com>"]
|
||||
description = "Unified storage & file system abstraction: one driver interface over Local Disk, S3/MinIO, and Google Cloud Storage, with stream-based upload/download."
|
||||
readme = "README.md"
|
||||
@@ -1,4 +1,4 @@
|
||||
# corex-storage
|
||||
# mytheclipse-storage
|
||||
|
||||
A unified storage & file system abstraction so file handling isn't locked to
|
||||
one physical location.
|
||||
@@ -14,7 +14,7 @@ requires holding it entirely in memory.
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use corex_storage::{LocalFileStorage, StorageDriver, bytes_stream, read_to_vec};
|
||||
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?;
|
||||
@@ -143,7 +143,7 @@ mod tests {
|
||||
|
||||
/// Requires a live GCS bucket with Application Default Credentials
|
||||
/// configured, and `GCS_BUCKET` set. Run with:
|
||||
/// `GCS_BUCKET=my-bucket cargo test -p corex-storage --features gcs -- --ignored`.
|
||||
/// `GCS_BUCKET=my-bucket cargo test -p mytheclipse-storage --features gcs -- --ignored`.
|
||||
#[tokio::test]
|
||||
#[ignore = "requires a live GCS bucket + Application Default Credentials"]
|
||||
async fn put_get_roundtrip_live() {
|
||||
@@ -151,15 +151,18 @@ mod tests {
|
||||
let storage = GcsStorage::connect(bucket).await.unwrap();
|
||||
storage
|
||||
.put(
|
||||
"corex-storage-test.txt",
|
||||
"mytheclipse-storage-test.txt",
|
||||
bytes_stream(b"hello gcs".to_vec()),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let data = read_to_vec(storage.get("corex-storage-test.txt").await.unwrap())
|
||||
let data = read_to_vec(storage.get("mytheclipse-storage-test.txt").await.unwrap())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(data, b"hello gcs");
|
||||
storage.delete("corex-storage-test.txt").await.unwrap();
|
||||
storage
|
||||
.delete("mytheclipse-storage-test.txt")
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//! # corex-storage
|
||||
//! # mytheclipse-storage
|
||||
//!
|
||||
//! A unified storage & file system abstraction so file handling doesn't get
|
||||
//! locked to one physical storage location.
|
||||
@@ -15,15 +15,22 @@
|
||||
//!
|
||||
//! ## Example
|
||||
//!
|
||||
//! ```
|
||||
//! use corex_storage::{LocalFileStorage, StorageDriver, bytes_stream, read_to_vec};
|
||||
//! # #[tokio::main] async fn main() {
|
||||
//! Local disk storage (`local` feature, default):
|
||||
//!
|
||||
//! ```no_run
|
||||
//! use mytheclipse_storage::{StorageDriver, bytes_stream, read_to_vec};
|
||||
//! # #[cfg(feature = "local")]
|
||||
//! # #[tokio::main]
|
||||
//! # async fn main() {
|
||||
//! use mytheclipse_storage::LocalFileStorage;
|
||||
//! # let dir = tempfile::tempdir().unwrap();
|
||||
//! let storage = LocalFileStorage::new(dir.path());
|
||||
//! storage.put("hello.txt", bytes_stream(b"hi".to_vec())).await.unwrap();
|
||||
//! let data = read_to_vec(storage.get("hello.txt").await.unwrap()).await.unwrap();
|
||||
//! assert_eq!(data, b"hi");
|
||||
//! # }
|
||||
//! # #[cfg(not(feature = "local"))]
|
||||
//! # fn main() {}
|
||||
//! ```
|
||||
|
||||
pub mod traits;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user