Compare commits

..

2 Commits

Author SHA1 Message Date
Konstantin
e4cf7d6960 config reporter for external apps 2025-02-07 16:00:19 +01:00
Konstantin
24c899a22b config reporter 2025-02-07 15:15:25 +01:00
2 changed files with 17 additions and 2 deletions

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
}

View File

@ -137,7 +137,7 @@ func GetConns() (storage.Conns, error) {
// LoadConfig initializes the configuration values after environment variables are loaded.
func LoadConfig() error {
configManager = NewConfig(logg)
// Add configuration keys with validation
configManager.AddKey("HOST", "127.0.0.1", false, nil)
configManager.AddKey("PORT", "7123", false, func(v string) error {
@ -145,7 +145,7 @@ func LoadConfig() error {
return err
})
configManager.AddKey("DB_CONN", "", true, nil)
// ... add other keys ...
// ... add other keys ? or is enough :/ ...
err := setConn()
if err != nil {