| 1 | use super::RepositoryResult; |
| 2 | use crate::domain::{OrgId, RepoId, RepoName, Repository}; |
| 3 | |
| 4 | |
| 5 | pub trait RepoRepository: Send + Sync { |
| 6 | fn find_by_id( |
| 7 | &self, |
| 8 | id: &RepoId, |
| 9 | ) -> impl Future<Output = RepositoryResult<Option<Repository>>> + Send; |
| 10 | |
| 11 | |
| 12 | fn find_by_org_and_name( |
| 13 | &self, |
| 14 | org_id: &OrgId, |
| 15 | name: &RepoName, |
| 16 | ) -> impl Future<Output = RepositoryResult<Option<Repository>>> + Send; |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | fn list_by_org( |
| 24 | &self, |
| 25 | org_id: &OrgId, |
| 26 | ) -> impl Future<Output = RepositoryResult<Vec<Repository>>> + Send; |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | fn save(&self, repo: &Repository) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 32 | } |