Skip to main content

auths_storage/
lib.rs

1//! Storage adapters for auths-id ports.
2//!
3//! This crate provides concrete implementations of the storage port traits
4//! defined in `auths-id::ports`. Each backend is gated behind a feature flag
5//! so consumers only pull in the dependencies they need.
6//!
7//! ## Features
8//!
9//! - `backend-git` — Git-backed storage via `libgit2` (enables `GitRegistryBackend`)
10//! - `backend-postgres` — PostgreSQL-backed storage via `sqlx` (stub, not yet implemented)
11//!
12//! ## Usage
13//!
14//! ```toml
15//! [dependencies]
16//! auths-storage = { path = "...", features = ["backend-git"] }
17//! ```
18//!
19//! Instantiate the backend and inject it at the composition root:
20//!
21//! ```rust,ignore
22//! use std::sync::Arc;
23//! use auths_id::ports::RegistryBackend;
24//! use auths_storage::git::GitRegistryBackend;
25//!
26//! let backend: Arc<dyn RegistryBackend + Send + Sync> =
27//!     Arc::new(GitRegistryBackend::new(config));
28//! ```
29
30#[cfg(feature = "backend-git")]
31pub mod git;
32
33#[cfg(feature = "backend-postgres")]
34pub mod postgres;