pub struct GitBackend { /* private fields */ }Expand description
Git HTTP backend wrapper
Handles Git Smart HTTP protocol by invoking git http-backend CGI.
Implementations§
Source§impl GitBackend
impl GitBackend
Sourcepub fn new(repo_path: impl AsRef<Path>) -> Self
pub fn new(repo_path: impl AsRef<Path>) -> Self
Create a new Git backend for the given repository path
Sourcepub fn with_backend_path(
repo_path: impl AsRef<Path>,
backend_path: Option<PathBuf>,
) -> Self
pub fn with_backend_path( repo_path: impl AsRef<Path>, backend_path: Option<PathBuf>, ) -> Self
Create a new Git backend with an explicit backend binary path
Sourcepub async fn run_cgi(
&self,
method: &str,
path_info: &str,
query_string: Option<&str>,
content_type: Option<&str>,
content_length: Option<u64>,
body_stream: impl Stream<Item = Result<Bytes, Error>> + Send + Unpin + 'static,
max_body_size: u64,
) -> Result<GitCgiStreamResponse>
pub async fn run_cgi( &self, method: &str, path_info: &str, query_string: Option<&str>, content_type: Option<&str>, content_length: Option<u64>, body_stream: impl Stream<Item = Result<Bytes, Error>> + Send + Unpin + 'static, max_body_size: u64, ) -> Result<GitCgiStreamResponse>
Run a Git CGI request with streaming I/O.
The request body is provided as an async stream of byte chunks. Returns parsed CGI headers plus a stream of the response body.
§Arguments
method- HTTP method (GET, POST)path_info- Path after the Git URL prefix (e.g., “/info/refs”)query_string- Query string (e.g., “service=git-upload-pack”)content_type- Content-Type header value (if any)content_length- Content-Length from the request (if known)body_stream- Stream of request body chunksmax_body_size- Maximum allowed body size in bytes
Sourcepub fn is_valid_repo(&self) -> bool
pub fn is_valid_repo(&self) -> bool
Check if the repository exists and is a valid Git repository
Auto Trait Implementations§
impl Freeze for GitBackend
impl RefUnwindSafe for GitBackend
impl Send for GitBackend
impl Sync for GitBackend
impl Unpin for GitBackend
impl UnwindSafe for GitBackend
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.