Skip to content

feat(config): add configuration validation#82

Merged
allisson merged 1 commit intomainfrom
improve-config
Mar 2, 2026
Merged

feat(config): add configuration validation#82
allisson merged 1 commit intomainfrom
improve-config

Conversation

@allisson
Copy link
Owner

@allisson allisson commented Mar 2, 2026

Introduce strict configuration validation and improve clarity of environment variable naming.

  • Implement Config.Validate() using jellydator/validation to ensure all settings are within valid ranges and do not conflict (e.g., SERVER_PORT vs METRICS_PORT).
  • Rename DB_CONN_MAX_LIFETIME to DB_CONN_MAX_LIFETIME_MINUTES to explicitly state the unit.
  • Rename SERVER_SHUTDOWN_TIMEOUT to SERVER_SHUTDOWN_TIMEOUT_SECONDS for consistency.
  • Add METRICS_PORT configuration (default: 8081).
  • Define default values as constants for better maintainability.
  • Update documentation and example files to match new configuration names.
  • Add comprehensive unit tests for configuration validation logic.

Introduce strict configuration validation and improve clarity of environment variable naming.

- Implement Config.Validate() using jellydator/validation to ensure all settings are within valid ranges and do not conflict (e.g., SERVER_PORT vs METRICS_PORT).
- Rename DB_CONN_MAX_LIFETIME to DB_CONN_MAX_LIFETIME_MINUTES to explicitly state the unit.
- Rename SERVER_SHUTDOWN_TIMEOUT to SERVER_SHUTDOWN_TIMEOUT_SECONDS for consistency.
- Add METRICS_PORT configuration (default: 8081).
- Define default values as constants for better maintainability.
- Update documentation and example files to match new configuration names.
- Add comprehensive unit tests for configuration validation logic.
@allisson allisson merged commit 6cf8d0f into main Mar 2, 2026
1 of 2 checks passed
@allisson allisson deleted the improve-config branch March 2, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant