diff --git a/Cargo.toml b/Cargo.toml index 76a17173..817ad31c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] - members = ["limitador", "limitador-server"] +resolver = "2" [profile.release] lto = true diff --git a/limitador/Cargo.toml b/limitador/Cargo.toml index e51e547f..6c15a85a 100644 --- a/limitador/Cargo.toml +++ b/limitador/Cargo.toml @@ -17,7 +17,7 @@ edition = "2021" default = ["disk_storage", "redis_storage"] disk_storage = ["rocksdb"] redis_storage = ["redis", "r2d2", "tokio"] -infinispan_storage = ["infinispan", "reqwest", "base64"] +infinispan_storage = ["infinispan", "reqwest", "base64", "tokio"] lenient_conditions = [] [dependencies] diff --git a/limitador/src/storage/expiring_value.rs b/limitador/src/storage/disk/expiring_value.rs similarity index 100% rename from limitador/src/storage/expiring_value.rs rename to limitador/src/storage/disk/expiring_value.rs diff --git a/limitador/src/storage/disk/mod.rs b/limitador/src/storage/disk/mod.rs index beba2377..011f6e2a 100644 --- a/limitador/src/storage/disk/mod.rs +++ b/limitador/src/storage/disk/mod.rs @@ -1,5 +1,6 @@ use crate::storage::StorageErr; +mod expiring_value; mod rocksdb_storage; pub use rocksdb_storage::RocksDbStorage as DiskStorage; diff --git a/limitador/src/storage/disk/rocksdb_storage.rs b/limitador/src/storage/disk/rocksdb_storage.rs index 0e4a34d0..f99ea49d 100644 --- a/limitador/src/storage/disk/rocksdb_storage.rs +++ b/limitador/src/storage/disk/rocksdb_storage.rs @@ -1,7 +1,7 @@ use crate::counter::Counter; use crate::limit::Limit; +use crate::storage::disk::expiring_value::ExpiringValue; use crate::storage::disk::OptimizeFor; -use crate::storage::expiring_value::ExpiringValue; use crate::storage::keys::bin::{ key_for_counter, partial_counter_from_counter_key, prefix_for_namespace, }; diff --git a/limitador/src/storage/mod.rs b/limitador/src/storage/mod.rs index 97b702e0..fec8b013 100644 --- a/limitador/src/storage/mod.rs +++ b/limitador/src/storage/mod.rs @@ -18,7 +18,11 @@ pub mod redis; pub mod infinispan; mod atomic_expiring_value; -mod expiring_value; +#[cfg(any( + feature = "disk_storage", + feature = "infinispan_storage", + feature = "redis_storage" +))] mod keys; pub enum Authorization {