mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
refactor(storage_impl): Integrate the composite store from external crate (#1921)
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
pub(crate) trait KvStorePartition {
|
||||
use std::sync::Arc;
|
||||
|
||||
pub trait KvStorePartition {
|
||||
fn partition_number(key: PartitionKey<'_>, num_partitions: u8) -> u32 {
|
||||
crc32fast::hash(key.to_string().as_bytes()) % u32::from(num_partitions)
|
||||
}
|
||||
@ -9,7 +11,7 @@ pub(crate) trait KvStorePartition {
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub(crate) enum PartitionKey<'a> {
|
||||
pub enum PartitionKey<'a> {
|
||||
MerchantIdPaymentId {
|
||||
merchant_id: &'a str,
|
||||
payment_id: &'a str,
|
||||
@ -26,3 +28,12 @@ impl<'a> std::fmt::Display for PartitionKey<'a> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait RedisConnInterface {
|
||||
fn get_redis_conn(
|
||||
&self,
|
||||
) -> error_stack::Result<
|
||||
Arc<redis_interface::RedisConnectionPool>,
|
||||
redis_interface::errors::RedisError,
|
||||
>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user