Files
continuwuity/src/admin/server/mod.rs
T

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

56 lines
920 B
Rust
Raw Normal View History

mod commands;
2025-01-24 07:04:29 +00:00
use std::path::PathBuf;
use clap::Subcommand;
2024-12-14 21:58:01 -05:00
use conduwuit::Result;
2024-07-27 00:11:41 +00:00
use crate::admin_command_dispatch;
2024-07-27 00:11:41 +00:00
#[admin_command_dispatch]
#[derive(Debug, Subcommand)]
2025-05-24 00:28:09 +01:00
pub enum ServerCommand {
/// Time elapsed since startup
2024-04-26 18:55:45 -07:00
Uptime,
/// Show configuration values
ShowConfig,
/// Reload configuration values
2025-01-24 07:04:29 +00:00
ReloadConfig {
path: Option<PathBuf>,
},
/// Print database memory usage statistics
MemoryUsage,
/// Clears all of Continuwuity's caches
2024-07-04 03:26:19 +00:00
ClearCaches,
/// Performs an online backup of the database (only available for RocksDB
/// at the moment)
BackupDatabase,
/// List database backups
ListBackups,
/// Send a message to the admin room.
2024-06-16 02:10:47 +00:00
AdminNotice {
message: Vec<String>,
},
/// Hot-reload the server
2024-07-27 00:11:41 +00:00
#[clap(alias = "reload")]
ReloadMods,
2024-06-16 01:44:41 +00:00
2024-06-16 19:46:32 +00:00
#[cfg(unix)]
/// Restart the server
2024-07-03 04:46:50 +00:00
Restart {
#[arg(short, long)]
force: bool,
},
2024-06-16 19:46:32 +00:00
/// Shutdown the server
2024-06-16 01:44:41 +00:00
Shutdown,
}