| 1 | use super::RepositoryResult; |
| 2 | use crate::domain::{PushEvent, PushEventId, RepoId}; |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | pub trait PushEventRepository: Send + Sync { |
| 10 | fn find( |
| 11 | &self, |
| 12 | id: &PushEventId, |
| 13 | ) -> impl Future<Output = RepositoryResult<Option<PushEvent>>> + Send; |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | fn list_by_repo( |
| 20 | &self, |
| 21 | repo_id: &RepoId, |
| 22 | limit: usize, |
| 23 | ) -> impl Future<Output = RepositoryResult<Vec<PushEvent>>> + Send; |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | fn list_recent( |
| 34 | &self, |
| 35 | repo_ids: &[RepoId], |
| 36 | limit: usize, |
| 37 | ) -> impl Future<Output = RepositoryResult<Vec<PushEvent>>> + Send; |
| 38 | |
| 39 | fn save(&self, event: &PushEvent) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 40 | } |