pub struct GitIndexerClient { /* private fields */ }Expand description
Client for interacting with a Helix DB instance.
Use GitIndexerClient::builder() to create a new client.
§Example
use git_indexer::GitIndexerClient;
let client = GitIndexerClient::builder()
.endpoint("http://localhost:6969")
.build()?;
let git_info = client.index_repository("/path/to/repo").await?;Implementations§
Source§impl GitIndexerClient
impl GitIndexerClient
Sourcepub fn builder() -> GitIndexerClientBuilder
pub fn builder() -> GitIndexerClientBuilder
Create a new builder for configuring a GitIndexerClient.
Sourcepub async fn index_repository<P: AsRef<Path>>(
&self,
repo_path: P,
) -> Result<GitInfo>
pub async fn index_repository<P: AsRef<Path>>( &self, repo_path: P, ) -> Result<GitInfo>
Index a git repository and push all data to Helix DB.
This is the main entry point for indexing a repository. It will:
- Extract all git information (branches, commits, file changes)
- Create nodes for each branch, commit, and file change
- Create edges for parent-child commit relationships
§Arguments
repo_path- Path to the git repository
§Returns
Returns the extracted GitInfo after successfully pushing to Helix DB.
Sourcepub async fn create_commit_node(&self, commit: &CommitInfo) -> Result<()>
pub async fn create_commit_node(&self, commit: &CommitInfo) -> Result<()>
Sourcepub async fn create_branch_node(&self, branch: &BranchInfo) -> Result<()>
pub async fn create_branch_node(&self, branch: &BranchInfo) -> Result<()>
Sourcepub async fn create_file_node(
&self,
file: &FileChange,
commit_id: &str,
) -> Result<()>
pub async fn create_file_node( &self, file: &FileChange, commit_id: &str, ) -> Result<()>
Create a file change node in Helix DB.
§Arguments
file- The file change information to storecommit_id- The SHA of the commit this file change belongs to
Trait Implementations§
Source§impl Clone for GitIndexerClient
impl Clone for GitIndexerClient
Source§fn clone(&self) -> GitIndexerClient
fn clone(&self) -> GitIndexerClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GitIndexerClient
impl RefUnwindSafe for GitIndexerClient
impl Send for GitIndexerClient
impl Sync for GitIndexerClient
impl Unpin for GitIndexerClient
impl UnwindSafe for GitIndexerClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more