feat(proxy): add mockall automock to all proxy sub-services
This commit is contained in:
@@ -23,6 +23,7 @@ pub struct UpdateAccessRuleParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait AccessRuleService: Send + Sync + 'static {
|
pub trait AccessRuleService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<AccessRuleConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<AccessRuleConfig>;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ pub struct UpdateCacheZoneParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait CacheZoneService: Send + Sync + 'static {
|
pub trait CacheZoneService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<CacheZoneConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<CacheZoneConfig>;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ pub struct ConfigInheritanceRecord {
|
|||||||
pub applied_at: chrono::NaiveDateTime,
|
pub applied_at: chrono::NaiveDateTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait ConfigInheritanceService: Send + Sync + 'static {
|
pub trait ConfigInheritanceService: Send + Sync + 'static {
|
||||||
async fn add(
|
async fn add(
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ pub struct UpdateLimitRuleParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait LimitRuleService: Send + Sync + 'static {
|
pub trait LimitRuleService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LimitRuleConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<LimitRuleConfig>;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ pub struct UpdateLimitZoneParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait LimitZoneService: Send + Sync + 'static {
|
pub trait LimitZoneService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LimitZoneConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<LimitZoneConfig>;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ pub struct UpdateLocationBlockParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait LocationBlockService: Send + Sync + 'static {
|
pub trait LocationBlockService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LocationBlockConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<LocationBlockConfig>;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ pub struct UpdateLogSettingParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait LogSettingService: Send + Sync + 'static {
|
pub trait LogSettingService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<LogSettingConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<LogSettingConfig>;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ pub struct UpdateProxySettingParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait ProxySettingService: Send + Sync + 'static {
|
pub trait ProxySettingService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<ProxySettingConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<ProxySettingConfig>;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ pub struct UpdateRewriteRuleParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait RewriteRuleService: Send + Sync + 'static {
|
pub trait RewriteRuleService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<RewriteRuleConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<RewriteRuleConfig>;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ pub struct UpdateServerBlockParams {
|
|||||||
pub override_of_id: Option<Option<Uuid>>,
|
pub override_of_id: Option<Option<Uuid>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait ServerBlockService: Send + Sync + 'static {
|
pub trait ServerBlockService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<ServerBlockConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<ServerBlockConfig>;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ pub struct UpdateSslCertificateParams {
|
|||||||
pub expiry_date: Option<chrono::DateTime<Utc>>,
|
pub expiry_date: Option<chrono::DateTime<Utc>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, mockall::automock)]
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait SslCertificateService: Send + Sync + 'static {
|
pub trait SslCertificateService: Send + Sync + 'static {
|
||||||
async fn get(&self, id: Uuid) -> ProxyServiceResult<SslCertificateConfig>;
|
async fn get(&self, id: Uuid) -> ProxyServiceResult<SslCertificateConfig>;
|
||||||
|
|||||||
Reference in New Issue
Block a user