mirror of
https://github.com/mikedilger/chorus.git
synced 2026-02-02 06:25:12 +00:00
29 lines
696 B
Rust
29 lines
696 B
Rust
use crate::config::Config;
|
|
use crate::store::Store;
|
|
use hyper::server::conn::Http;
|
|
use lazy_static::lazy_static;
|
|
use std::sync::OnceLock;
|
|
use tokio::sync::RwLock;
|
|
|
|
pub struct Globals {
|
|
pub config: RwLock<Config>,
|
|
pub store: OnceLock<Store>,
|
|
pub http_server: Http,
|
|
pub rid: OnceLock<String>,
|
|
}
|
|
|
|
lazy_static! {
|
|
pub static ref GLOBALS: Globals = {
|
|
let mut http_server = hyper::server::conn::Http::new();
|
|
http_server.http1_only(true);
|
|
http_server.http1_keep_alive(true);
|
|
|
|
Globals {
|
|
config: RwLock::new(Config::default()),
|
|
store: OnceLock::new(),
|
|
http_server,
|
|
rid: OnceLock::new(),
|
|
}
|
|
};
|
|
}
|