mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-04 05:59:48 +08:00 
			
		
		
		
	feat(opensearch): refactoring (#4244)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
		@ -10,6 +10,7 @@ pub mod refunds;
 | 
			
		||||
pub mod api_event;
 | 
			
		||||
pub mod connector_events;
 | 
			
		||||
pub mod health_check;
 | 
			
		||||
pub mod opensearch;
 | 
			
		||||
pub mod outgoing_webhook_event;
 | 
			
		||||
pub mod sdk_events;
 | 
			
		||||
pub mod search;
 | 
			
		||||
@ -668,47 +669,6 @@ pub struct ReportConfig {
 | 
			
		||||
    pub region: String,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, Debug, serde::Deserialize)]
 | 
			
		||||
#[serde(tag = "auth")]
 | 
			
		||||
#[serde(rename_all = "lowercase")]
 | 
			
		||||
pub enum OpensearchAuth {
 | 
			
		||||
    Basic { username: String, password: String },
 | 
			
		||||
    Aws { region: String },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, Debug, serde::Deserialize)]
 | 
			
		||||
pub struct OpensearchIndexes {
 | 
			
		||||
    pub payment_attempts: String,
 | 
			
		||||
    pub payment_intents: String,
 | 
			
		||||
    pub refunds: String,
 | 
			
		||||
    pub disputes: String,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, Debug, serde::Deserialize)]
 | 
			
		||||
pub struct OpensearchConfig {
 | 
			
		||||
    host: String,
 | 
			
		||||
    auth: OpensearchAuth,
 | 
			
		||||
    indexes: OpensearchIndexes,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl Default for OpensearchConfig {
 | 
			
		||||
    fn default() -> Self {
 | 
			
		||||
        Self {
 | 
			
		||||
            host: "https://localhost:9200".to_string(),
 | 
			
		||||
            auth: OpensearchAuth::Basic {
 | 
			
		||||
                username: "admin".to_string(),
 | 
			
		||||
                password: "admin".to_string(),
 | 
			
		||||
            },
 | 
			
		||||
            indexes: OpensearchIndexes {
 | 
			
		||||
                payment_attempts: "hyperswitch-payment-attempt-events".to_string(),
 | 
			
		||||
                payment_intents: "hyperswitch-payment-intent-events".to_string(),
 | 
			
		||||
                refunds: "hyperswitch-refund-events".to_string(),
 | 
			
		||||
                disputes: "hyperswitch-dispute-events".to_string(),
 | 
			
		||||
            },
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Analytics Flow routes Enums
 | 
			
		||||
/// Info - Dimensions and filters available for the domain
 | 
			
		||||
/// Filters - Set of values present for the dimension
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user