//! Thin delegation layer: keeps the stable `GitService` LFS API surface while //! all logic lives in [`crate::lfs`]. use uuid::Uuid; use crate::lfs; pub use crate::lfs::types::*; use crate::service::GitService; use crate::share::errors::GitError; impl GitService { pub async fn lfs_batch( &self, space_name: String, repo_name: String, req: LfsBatchRequest, ) -> Result { lfs::batch(self, space_name, repo_name, req).await } #[allow(clippy::too_many_arguments)] pub async fn lfs_upload( &self, space_name: String, repo_name: String, caller: Uuid, oid: String, size: i64, content_type: Option, body: Vec, ) -> Result { lfs::upload( self, space_name, repo_name, caller, oid, size, content_type, body, ) .await } #[allow(clippy::too_many_arguments)] pub async fn lfs_upload_stream( &self, space_name: String, repo_name: String, caller: Uuid, oid: String, size: i64, content_type: Option, reader: R, ) -> Result where R: tokio::io::AsyncRead + Unpin + Send, { lfs::upload_stream( self, space_name, repo_name, caller, oid, size, content_type, reader, ) .await } pub async fn lfs_download_to( &self, space_name: String, repo_name: String, oid: String, writer: &mut W, ) -> Result where W: tokio::io::AsyncWrite + Send + Unpin, { lfs::download_to(self, space_name, repo_name, oid, writer).await } pub async fn lfs_verify( &self, space_name: String, repo_name: String, req: LfsVerifyRequest, ) -> Result<(), GitError> { lfs::verify_object(self, space_name, repo_name, req).await } pub async fn lfs_download( &self, space_name: String, repo_name: String, oid: String, ) -> Result, GitError> { lfs::download(self, space_name, repo_name, oid).await } pub async fn lfs_lock( &self, space_name: String, repo_name: String, owner: Uuid, path: String, oid: Option, ) -> Result { lfs::create_lock(self, space_name, repo_name, owner, path, oid).await } pub async fn lfs_unlock( &self, space_name: String, repo_name: String, owner: Uuid, path: String, force: bool, ) -> Result<(), GitError> { lfs::unlock(self, space_name, repo_name, owner, path, force).await } pub async fn lfs_unlock_by_id( &self, space_name: String, repo_name: String, owner: Uuid, lock_id: String, force: bool, ) -> Result<(), GitError> { lfs::unlock_by_id(self, space_name, repo_name, owner, lock_id, force).await } pub async fn lfs_list_locks( &self, space_name: String, repo_name: String, cursor: Option, limit: u64, ) -> Result { lfs::list_locks(self, space_name, repo_name, cursor, limit).await } pub async fn lfs_verify_locks( &self, space_name: String, repo_name: String, caller: Uuid, limit: u64, ) -> Result { lfs::verify_locks(self, space_name, repo_name, caller, limit).await } pub async fn lfs_cleanup_unreferenced( &self, space_name: String, repo_name: String, ) -> Result { lfs::cleanup_unreferenced(self, space_name, repo_name).await } }