use std::{
collections::HashMap,
time::{Duration, Instant},
};
mod bucket;
mod fixed;
mod fixed_bucket;
pub struct FixedLimit {
maximum_request: usize,
duration: Duration,
requests: HashMap<String, (usize, Instant)>,
}
pub struct Selfb {
pub remaning_count: u64,
pub is_allowed: bool,
}
pub struct TokenBucket {
capacity: u64,
rates: f64,
last_update: HashMap<String, (f64, Instant)>,
}
pub struct FixedBucket {
request: u64,
duration: Duration,
capacity: u64,
rates: f64,
last_update: HashMap<String, (f64, Instant)>,
requests: HashMap<String, (u64, Instant)>,
}