mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(multitenancy): add support for multitenancy and handle the same in router, producer, consumer, drainer and analytics (#4630)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
use common_utils::DbConnectionParams;
|
||||
use masking::Secret;
|
||||
|
||||
#[derive(Debug, Clone, serde::Deserialize)]
|
||||
@ -14,6 +15,29 @@ pub struct Database {
|
||||
pub max_lifetime: Option<u64>,
|
||||
}
|
||||
|
||||
impl DbConnectionParams for Database {
|
||||
fn get_username(&self) -> &str {
|
||||
&self.username
|
||||
}
|
||||
fn get_password(&self) -> Secret<String> {
|
||||
self.password.clone()
|
||||
}
|
||||
fn get_host(&self) -> &str {
|
||||
&self.host
|
||||
}
|
||||
fn get_port(&self) -> u16 {
|
||||
self.port
|
||||
}
|
||||
fn get_dbname(&self) -> &str {
|
||||
&self.dbname
|
||||
}
|
||||
}
|
||||
|
||||
pub trait TenantConfig: Send + Sync {
|
||||
fn get_schema(&self) -> &str;
|
||||
fn get_redis_key_prefix(&self) -> &str;
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, Clone, Copy, Default)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub enum QueueStrategy {
|
||||
|
||||
Reference in New Issue
Block a user