Skip to main content

GitStorage

Trait GitStorage 

Source
pub trait GitStorage: Send + Sync {
    // Required methods
    fn store(
        &self,
        repo_path: &Path,
        session_id: &str,
        hail_jsonl: &[u8],
        meta_json: &[u8],
    ) -> Result<String>;
    fn load(
        &self,
        repo_path: &Path,
        session_id: &str,
    ) -> Result<Option<Vec<u8>>>;
    fn list(&self, repo_path: &Path) -> Result<Vec<String>>;
}
Expand description

Trait for git-based session storage backends.

Required Methods§

Source

fn store( &self, repo_path: &Path, session_id: &str, hail_jsonl: &[u8], meta_json: &[u8], ) -> Result<String>

Store a session in the git repository at repo_path.

Creates the orphan branch if it doesn’t exist, then adds/updates blobs for the HAIL JSONL and metadata JSON under v1/<prefix>/<id>.*.

Returns the relative path within the branch (e.g. v1/ab/abcdef.hail.jsonl).

Source

fn load(&self, repo_path: &Path, session_id: &str) -> Result<Option<Vec<u8>>>

Load a session’s HAIL JSONL bytes from the git branch.

Source

fn list(&self, repo_path: &Path) -> Result<Vec<String>>

List all stored session IDs.

Implementors§