lemmy/server/src/rate_limit/mod.rs
Dessalines f300c67a4d Adding websocket notification system.
- HTTP and APUB clients can now send live updating messages to websocket
  clients
- Rate limiting now affects both HTTP and websockets
- Rate limiting / Websocket logic is now moved into the API Perform
  functions.
- TODO This broke getting current online users, but that will have to
  wait for the perform trait to be made async.
- Fixes #446
2020-04-19 18:08:25 -04:00

19 lines
392 B
Rust

pub mod rate_limiter;
use super::{IPAddr, Settings};
use crate::api::APIError;
use failure::Error;
use log::warn;
use rate_limiter::RateLimiter;
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::Mutex;
use std::time::SystemTime;
use strum::IntoEnumIterator;
#[derive(Debug, Clone)]
pub struct RateLimitInfo {
pub rate_limiter: Arc<Mutex<RateLimiter>>,
pub ip: IPAddr,
}