Skip to content

Commit

Permalink
add cve repo
Browse files Browse the repository at this point in the history
  • Loading branch information
n1nj4t4nuk1 committed Dec 3, 2024
1 parent 1adb6a8 commit b362b4c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/cti/src/cves/domain/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod entities;
pub mod events;
pub mod events;
pub mod repositories;
10 changes: 10 additions & 0 deletions libs/cti/src/cves/domain/repositories/cve_repository.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use crate::{cves::domain::entities::{cve::Cve, cve_id::CveId}, shared::domain::errors::DomainError};
use async_trait::async_trait;

#[async_trait]
pub trait CveRepository: Send + Sync + 'static {
async fn find_by_id(&self, id: &CveId) -> Result<Cve, DomainError>;
async fn create_one(&self, user: &Cve) -> Result<(), DomainError>;
async fn update_one(&self, user: &Cve) -> Result<(), DomainError>;
async fn delete_one(&self, id: &CveId) -> Result<(), DomainError>;
}
1 change: 1 addition & 0 deletions libs/cti/src/cves/domain/repositories/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod cve_repository;

0 comments on commit b362b4c

Please sign in to comment.