Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(quotas): Split up quotas code into submodules #600

Merged
merged 1 commit into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion relay-quotas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish = false

[features]
default = []
rate-limiter = [
redis = [
"failure",
"log",
"relay-redis/impl",
Expand Down
2 changes: 1 addition & 1 deletion relay-quotas/src/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use serde::{ser::SerializeSeq, Deserialize, Deserializer, Serialize, Serializer};
use smallvec::smallvec;

use crate::types::{DataCategory, Quota, QuotaScope, ReasonCode};
use crate::quota::{DataCategory, Quota, QuotaScope, ReasonCode};

/// Legacy format of the `Quota` type.
#[derive(Deserialize, Serialize)]
Expand Down
19 changes: 13 additions & 6 deletions relay-quotas/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

#![warn(missing_docs)]

mod types;
pub use self::types::*;
/// The default timeout to apply when a scope is fully rejected. This
/// typically happens for disabled keys, projects, or organizations.
const REJECT_ALL_SECS: u64 = 60;

mod quota;
mod rate_limit;

pub use self::quota::*;
pub use self::rate_limit::*;

#[cfg(feature = "legacy")]
pub mod legacy;

#[cfg(feature = "rate-limiter")]
mod rate_limiter;
#[cfg(feature = "rate-limiter")]
pub use self::rate_limiter::*;
#[cfg(feature = "redis")]
mod redis;
#[cfg(feature = "redis")]
pub use self::redis::*;
Loading