hyperapi/
lib.rs

1pub mod proxy;
2pub mod config;
3pub mod middleware;
4pub mod auth;
5
6
7#[macro_export]
8macro_rules! start_middleware_macro {
9    ($t:ty, $s:expr, $c:expr) => {
10        let (tx, rx) = mpsc::channel(16);
11        let conf_update = $c.subscribe();
12        tokio::spawn(async move {
13            event!(Level::INFO, "Starting UpstreamMiddleware");
14            crate::middleware::start_middleware::<$t>(rx, conf_update).await
15        });
16        $s.push(crate::middleware::MiddlewareHandle {
17            name: <$t>::name(),
18            pre: <$t>::pre(),
19            post: <$t>::post(),
20            require_setting: <$t>::require_setting(),
21            chan: tx,
22        });
23    };
24}
25
26
27