dataplane_sdk/core/db/
control_plane.rs1use crate::core::{error::DbResult, model::control_plane::ControlPlane};
14pub mod memory;
15
16#[cfg(test)]
17use crate::core::db::tx::MockTransaction;
18
19#[async_trait::async_trait]
20#[cfg_attr(test, mockall::automock(type Transaction = MockTransaction;))]
21pub trait ControlPlaneRepo: Send + Sync {
22 type Transaction;
23
24 async fn create(
25 &self,
26 tx: &mut Self::Transaction,
27 control_plane: &ControlPlane,
28 ) -> DbResult<()>;
29
30 async fn fetch_by_id(
31 &self,
32 tx: &mut Self::Transaction,
33 control_plane_id: &str,
34 ) -> DbResult<Option<ControlPlane>>;
35}