This commit is contained in:
2025-08-16 15:16:15 +02:00
parent 84611dd245
commit ee163bb6bf
8 changed files with 26 additions and 11 deletions

View File

@@ -8,13 +8,11 @@ use libcrypto::CryptoFactory; // Correct import
use redb::{Database, TableDefinition};
use serde::{Deserialize, Serialize};
pub use crate::error::DBError; // Re-export for users of this crate
pub mod error; // Declare the error module
pub use error::DBError; // Re-export for users of this crate
// Declare modules
pub mod storage_basic;
pub mod storage_hset;
pub mod storage_lists;
pub mod storage_extra;
// Declare storage module
pub mod storage;
// Table definitions for different Redis data types
const TYPES_TABLE: TableDefinition<&str, &str> = TableDefinition::new("types");

View File

@@ -0,0 +1,4 @@
pub mod storage_basic;
pub mod storage_hset;
pub mod storage_lists;
pub mod storage_extra;

View File

@@ -1,6 +1,6 @@
use redb::{ReadableTable};
use crate::error::DBError;
use super::*;
use crate::{Storage, TYPES_TABLE, STRINGS_TABLE, HASHES_TABLE, LISTS_TABLE, STREAMS_META_TABLE, STREAMS_DATA_TABLE, EXPIRATION_TABLE, now_in_millis};
impl Storage {
pub fn flushdb(&self) -> Result<(), DBError> {

View File

@@ -1,6 +1,6 @@
use redb::{ReadableTable};
use crate::error::DBError;
use super::*;
use crate::{Storage, TYPES_TABLE, STRINGS_TABLE, EXPIRATION_TABLE, now_in_millis};
impl Storage {
// ✅ ENCRYPTION APPLIED: Values are decrypted after retrieval

View File

@@ -1,6 +1,6 @@
use redb::{ReadableTable};
use crate::error::DBError;
use super::*;
use crate::{Storage, TYPES_TABLE, HASHES_TABLE};
impl Storage {
// ✅ ENCRYPTION APPLIED: Values are encrypted before storage

View File

@@ -1,6 +1,6 @@
use redb::{ReadableTable};
use crate::error::DBError;
use super::*;
use crate::{Storage, TYPES_TABLE, LISTS_TABLE};
impl Storage {
// ✅ ENCRYPTION APPLIED: Elements are encrypted before storage