Skip to content

Conversation

@Kitt3120
Copy link
Contributor

This pull request includes significant changes to the configuration management system, refactoring the code to separate file-based and environment-based configurations. The most important changes include the addition of new modules for handling configurations, the introduction of a trait for merging configurations, and updates to the main application code to use the new configuration structures.

Configuration Management Refactor:

  • Cargo.toml: Added serde-env dependency to support environment-based configuration.
  • src/config.rs: Removed old configuration management code and restructured to use new modules config_handler, environment_config, and file_config.
  • src/config/config_handler.rs: Introduced ConfigHandler struct with methods to load configurations from file and environment, and a Merge trait for merging configurations.
  • src/config/environment_config.rs: Created EnvironmentConfig struct to handle environment-based configurations.
  • src/config/file_config.rs: Created FileConfig struct to handle file-based configurations and implemented the Merge trait for merging with EnvironmentConfig.

Main Application Updates:

  • src/main.rs: Updated to use FileConfig instead of the old Config struct in service initialization. [1] [2]

@Kitt3120 Kitt3120 self-assigned this Oct 19, 2024
@Kitt3120 Kitt3120 linked an issue Oct 19, 2024 that may be closed by this pull request
@Kitt3120 Kitt3120 added feature Adds or requests new feature refactor Optimizes or restructures code labels Oct 19, 2024
@Kitt3120 Kitt3120 enabled auto-merge (squash) October 19, 2024 21:22
@Kitt3120 Kitt3120 merged commit 1655827 into main Oct 19, 2024
3 checks passed
@Kitt3120 Kitt3120 deleted the refactor/config branch October 19, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adds or requests new feature refactor Optimizes or restructures code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Rework Config

2 participants