Compare commits

..

1 Commits

Author SHA1 Message Date
Konstantin
86bf9b10af config reporter 2025-02-07 14:51:36 +01:00
2 changed files with 2 additions and 17 deletions

15
.vscode/launch.json vendored
View File

@ -1,15 +0,0 @@
{
// 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 ? or is enough :/ ...
// ... add other keys ...
err := setConn()
if err != nil {