This commit is contained in:
nquidox 2025-07-06 17:59:18 +03:00
commit 995ea60f34
11 changed files with 449 additions and 0 deletions

24
config/getEnv.go Normal file
View file

@ -0,0 +1,24 @@
package config
import (
"os"
"strconv"
)
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}
func getEnvInt(key string, fallback int) int {
if value, ok := os.LookupEnv(key); ok {
num, err := strconv.Atoi(value)
if err != nil {
return fallback
}
return num
}
return fallback
}