| 1 | use super::RepositoryResult; |
| 2 | use crate::domain::{RepoId, Webhook, WebhookId}; |
| 3 | |
| 4 | |
| 5 | pub trait WebhookRepository: Send + Sync { |
| 6 | fn find( |
| 7 | &self, |
| 8 | id: &WebhookId, |
| 9 | ) -> impl Future<Output = RepositoryResult<Option<Webhook>>> + Send; |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | fn list_by_repo( |
| 19 | &self, |
| 20 | repo_id: &RepoId, |
| 21 | ) -> impl Future<Output = RepositoryResult<Vec<Webhook>>> + Send; |
| 22 | |
| 23 | fn save(&self, webhook: &Webhook) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | fn delete(&self, id: &WebhookId) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 30 | } |