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

11
Cargo.lock generated
View File

@@ -197,6 +197,15 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]
[[package]]
name = "bitflags"
version = "2.9.2"
@@ -965,11 +974,13 @@ dependencies = [
name = "libdbstorage"
version = "0.1.0"
dependencies = [
"bincode",
"libcrypto",
"redb",
"serde",
"serde_json",
"thiserror",
"tokio",
]
[[package]]

View File

@@ -11,3 +11,5 @@ thiserror = { workspace = true }
# Local Crate Dependencies
libcrypto = { path = "../libcrypto" }
tokio = { version = "1", features = ["full"] }
bincode = "1.3.3"

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