Files
gitks/server/archive.rs
T
zhenyi 998f393ed0 feat(server): add comprehensive Git repository services with test coverage
- Implement ArchiveService for repository archive operations
- Add BlameService for Git blame functionality
- Create BranchService with full branch management capabilities
- Integrate CommitService for commit operations and history
- Add DiffService for generating diffs and patches
- Implement MergeService with conflict resolution features
- Add PackService for Git packfile operations
- Create TagService for Git tag management
- Add TreeService for Git tree operations
- Implement comprehensive repository management functions
- Add repository statistics and health checking capabilities
- Include garbage collection and repacking operations
- Add repository configuration management
- Implement error handling and status conversion utilities
- Add test suite covering all repository operations
- Create utility functions for Git command execution
- Add streaming response support for large data operations
- Implement request resolution and validation helpers
2026-06-04 14:10:21 +08:00

30 lines
1.0 KiB
Rust

use crate::pb::*;
use super::{GitksService, into_status, into_stream, resolve};
#[tonic::async_trait]
impl archive_service_server::ArchiveService for GitksService {
type GetArchiveStream =
tokio_stream::wrappers::ReceiverStream<Result<ArchiveChunk, tonic::Status>>;
async fn get_archive(
&self,
request: tonic::Request<ArchiveRequest>,
) -> Result<tonic::Response<Self::GetArchiveStream>, tonic::Status> {
let inner = request.into_inner();
let gb = resolve(inner.repository.as_ref())?;
let chunks = gb.get_archive(inner).map_err(into_status)?;
Ok(tonic::Response::new(into_stream(chunks)))
}
async fn list_archive_entries(
&self,
request: tonic::Request<ListArchiveEntriesRequest>,
) -> Result<tonic::Response<ListArchiveEntriesResponse>, tonic::Status> {
let inner = request.into_inner();
let gb = resolve(inner.repository.as_ref())?;
let resp = gb.list_archive_entries(inner).map_err(into_status)?;
Ok(tonic::Response::new(resp))
}
}