Files
continuwuity/src/admin/mod.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.1 KiB
Rust
Raw Normal View History

2024-07-18 06:37:47 +00:00
#![recursion_limit = "168"]
2024-06-16 01:44:41 +00:00
#![allow(clippy::wildcard_imports)]
2024-07-22 22:24:17 +00:00
pub(crate) mod admin;
pub(crate) mod handler;
mod tests;
pub(crate) mod utils;
2024-05-09 15:59:08 -07:00
pub(crate) mod appservice;
2024-06-23 09:55:51 +00:00
pub(crate) mod check;
2024-05-09 15:59:08 -07:00
pub(crate) mod debug;
pub(crate) mod federation;
pub(crate) mod media;
pub(crate) mod query;
pub(crate) mod room;
pub(crate) mod server;
pub(crate) mod user;
extern crate conduit_api as api;
extern crate conduit_core as conduit;
extern crate conduit_service as service;
pub(crate) use conduit::{mod_ctor, mod_dtor, Result};
2024-07-22 07:43:51 +00:00
pub(crate) use service::services;
2024-05-09 15:59:08 -07:00
2024-07-20 23:38:20 +00:00
pub(crate) use crate::utils::{escape_html, get_room_info};
2024-05-09 15:59:08 -07:00
2024-07-22 22:24:17 +00:00
pub(crate) const PAGE_SIZE: usize = 100;
2024-05-09 15:59:08 -07:00
mod_ctor! {}
mod_dtor! {}
2024-07-05 01:44:43 +00:00
/// Install the admin command handler
pub async fn init() {
2024-07-05 07:52:05 +00:00
_ = services()
.admin
.complete
.write()
.expect("locked for writing")
.insert(handler::complete);
2024-07-05 08:39:37 +00:00
_ = services()
.admin
.handle
.write()
.await
.insert(handler::handle);
2024-07-05 01:44:43 +00:00
}
/// Uninstall the admin command handler
pub async fn fini() {
2024-07-05 08:39:37 +00:00
_ = services().admin.handle.write().await.take();
2024-07-05 07:52:05 +00:00
_ = services()
.admin
.complete
.write()
.expect("locked for writing")
.take();
2024-07-05 01:44:43 +00:00
}