Skip to content

Commit 981547b

Browse files
committed
refactor: [#255] move database module into config/core
- Convert core.rs into folder module (config/core/) - Move database module into config/core/database/ - Update imports to reflect new structure - Database types now exported through config module hierarchy - Improves logical grouping (database is part of core config) - All 1582 tests passing - All linters passing
1 parent eca6dff commit 981547b

6 files changed

Lines changed: 7 additions & 11 deletions

File tree

File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
33
use serde::{Deserialize, Serialize};
44

5-
use crate::domain::tracker::DatabaseConfig;
5+
mod database;
6+
7+
pub use database::{DatabaseConfig, MysqlConfig, SqliteConfig};
68

79
/// Core tracker configuration options
810
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
@@ -17,7 +19,6 @@ pub struct TrackerCoreConfig {
1719
#[cfg(test)]
1820
mod tests {
1921
use super::*;
20-
use crate::domain::tracker::{DatabaseConfig, SqliteConfig};
2122

2223
#[test]
2324
fn it_should_create_core_config() {

src/domain/tracker/config/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ mod http;
1313
mod http_api;
1414
mod udp;
1515

16-
pub use core::TrackerCoreConfig;
16+
pub use core::{DatabaseConfig, MysqlConfig, SqliteConfig, TrackerCoreConfig};
1717
pub use health_check_api::HealthCheckApiConfig;
1818
pub use http::HttpTrackerConfig;
1919
pub use http_api::HttpApiConfig;
2020
pub use udp::UdpTrackerConfig;
2121

22-
use super::{DatabaseConfig, SqliteConfig};
23-
2422
/// Tracker deployment configuration
2523
///
2624
/// This structure mirrors the real tracker configuration but only includes

src/domain/tracker/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
//!
66
//! # Module Structure
77
//!
8-
//! - `config` - Main `TrackerConfig` and component configurations
9-
//! - `database` - Database configuration (`SQLite`, `MySQL`)
8+
//! - `config` - Main `TrackerConfig` and component configurations (includes database)
109
//!
1110
//! # Layer Separation
1211
//!
@@ -46,10 +45,8 @@
4645
//! ```
4746
4847
mod config;
49-
mod database;
5048

5149
pub use config::{
52-
HealthCheckApiConfig, HttpApiConfig, HttpTrackerConfig, TrackerConfig, TrackerCoreConfig,
53-
UdpTrackerConfig,
50+
DatabaseConfig, HealthCheckApiConfig, HttpApiConfig, HttpTrackerConfig, MysqlConfig,
51+
SqliteConfig, TrackerConfig, TrackerCoreConfig, UdpTrackerConfig,
5452
};
55-
pub use database::{DatabaseConfig, MysqlConfig, SqliteConfig};

0 commit comments

Comments
 (0)