futr/src/config.rs
2025-11-16 20:25:52 +03:00

57 lines
1.5 KiB
Rust

use serde::Deserialize;
#[derive(Deserialize, Clone)]
pub struct Config {
pub http_port: u16,
pub db_path: String,
pub log_level: String,
// Параметры кластера
pub cluster_enabled: bool,
pub node_id: String,
pub cluster_nodes: Vec<String>,
// Параметры ACL
pub acl_enabled: bool,
pub admin_users: Vec<String>,
// Параметры репликации
pub master_master_replication: bool,
pub replication_nodes: Vec<String>,
// Параметры HTTPS
pub https_enabled: bool,
pub https_port: u16,
pub cert_file: String,
pub key_file: String,
// Параметры HTTP2
pub http2_enabled: bool,
// Настройки хранимых процедур
pub stored_procedures_path: String,
}
impl Default for Config {
fn default() -> Self {
Self {
http_port: 8080,
db_path: "./data".to_string(),
log_level: "info".to_string(),
cluster_enabled: false,
node_id: "node_1".to_string(),
cluster_nodes: vec![],
acl_enabled: false,
admin_users: vec![],
master_master_replication: false,
replication_nodes: vec![],
https_enabled: false,
https_port: 8443,
cert_file: "./cert.pem".to_string(),
key_file: "./key.pem".to_string(),
http2_enabled: false,
stored_procedures_path: "./procedures".to_string(),
}
}
}