Skip to content

Commit 34ce5e7

Browse files
authored
Add crate-level re-exports to minikv_core lib (#10)
1 parent ba2725a commit 34ce5e7

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

minikv-core/src/lib.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
//! `minikv_core`
2+
//!
3+
//! Core library for a deterministic, replicated object metadata layer.
4+
//!
5+
//! This crate provides the hashing, volume selection, record encoding,
6+
//! replication, rebuild, and rebalance logic required to maintain
7+
//! a consistent mapping between object keys and storage volumes.
8+
//!
9+
//! The system is designed around the following principles:
10+
//!
11+
//! - Deterministic key → path mapping (`key_to_path`)
12+
//! - Deterministic key → replica selection (`key_to_volume`)
13+
//! - Explicit, auditable record encoding (`Record`)
14+
//! - Metadata recovery from storage volumes (`rebuild_all`)
15+
//! - Convergence to ideal replica placement (`rebalance_all`)
16+
//!
17+
//! The crate does not implement an HTTP server. It focuses strictly on:
18+
//!
19+
//! - Metadata representation and storage abstraction (`MetadataStore`)
20+
//! - Volume interaction primitives (`remote_get`, `remote_put`, etc.)
21+
//! - Replica placement and reconciliation logic
22+
//!
23+
//! All replica selection and ordering is deterministic. Any change to
24+
//! hashing or volume selection logic will change placement and is therefore
25+
//! considered a breaking behavioural change.
26+
//!
27+
//! # High-Level Architecture
28+
//!
29+
//! - `hashing` — Key-to-path and volume scoring primitives.
30+
//! - `volumes` — Replica selection and rebalance detection.
31+
//! - `record` — On-disk metadata encoding format.
32+
//! - `storage` — Metadata storage abstraction.
33+
//! - `replication` — HTTP primitives for volume interaction.
34+
//! - `rebuild` — Metadata reconstruction from volumes.
35+
//! - `rebalance` — Migration to ideal replica sets.
36+
//! - `locking` — Per-key concurrency control.
37+
//!
38+
//! This crate is intended to be embedded in a higher-level service.
39+
140
pub mod error;
241
pub mod hashing;
342
pub mod locking;
@@ -10,3 +49,12 @@ pub mod storage;
1049
pub mod volumes;
1150

1251
pub use error::Error;
52+
pub use hashing::{key_to_path, volume_score};
53+
pub use locking::{KeyGuard, KeyLock};
54+
pub use rebalance::{rebalance_all, rebalance_key};
55+
pub use rebuild::{AutoindexEntry, rebuild_all};
56+
pub use record::{Deleted, Record};
57+
pub use replication::{build_volume_client, remote_delete, remote_get, remote_head, remote_put};
58+
pub use state::AppState;
59+
pub use storage::{KeyValuePair, MetadataStore};
60+
pub use volumes::{key_to_volume, needs_rebalance};

0 commit comments

Comments
 (0)