opensession_git_native/
lib.rs1pub mod error;
2pub mod ops;
3pub mod shadow;
4pub mod store;
5pub mod url;
6
7#[cfg(test)]
8pub(crate) mod test_utils;
9
10pub use error::{GitStorageError, Result};
11pub use shadow::{
12 CheckpointInfo, FileRemoval, FileSnapshot, ShadowMeta, ShadowStorage, SHADOW_REF_PREFIX,
13};
14pub use store::NativeGitStorage;
15pub use url::generate_raw_url;
16
17use std::path::Path;
18
19pub const SESSIONS_BRANCH: &str = "opensession/sessions";
21
22pub const SESSIONS_REF: &str = "refs/heads/opensession/sessions";
24
25pub trait GitStorage: Send + Sync {
27 fn store(
34 &self,
35 repo_path: &Path,
36 session_id: &str,
37 hail_jsonl: &[u8],
38 meta_json: &[u8],
39 ) -> Result<String>;
40
41 fn load(&self, repo_path: &Path, session_id: &str) -> Result<Option<Vec<u8>>>;
43
44 fn list(&self, repo_path: &Path) -> Result<Vec<String>>;
46}