-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from pranav-bhatt/master
ImageHub(Feature addition): Generalised the paths and modularized the filter for easy addition of rules
- Loading branch information
Showing
7 changed files
with
197 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mod rules; | ||
|
||
pub use rules::JsonPath; | ||
pub use rules::RateLimiterJson; | ||
pub use rules::Rule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use serde::Deserialize; | ||
|
||
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd)] | ||
pub struct JsonPath { | ||
pub name: String, | ||
pub rule: Rule, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd)] | ||
#[serde(rename_all(deserialize = "kebab-case"))] | ||
#[serde(tag = "ruleType", content = "parameters")] | ||
pub enum Rule { | ||
RateLimiter(Vec<RateLimiterJson>), | ||
None, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, PartialEq, PartialOrd)] | ||
pub struct RateLimiterJson { | ||
pub identifier: String, | ||
pub limit: u32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod rate_limiter; | ||
|
||
pub use rate_limiter::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters