This commit is contained in:
2024-04-20 16:45:56 +03:00
commit 937c8d8eab
34 changed files with 3048 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package config
import (
"os"
"strconv"
)
var (
config *Config
)
type Config struct {
ApplicationName string
ApplicationPort int64
LoggingLevel string
PostgresDSN string
}
func GetConfig() *Config {
port, _ := strconv.ParseInt(os.Getenv("SERVING_PORT"), 10, 64)
config = &Config{
ApplicationName: os.Getenv("APP_NAME"),
ApplicationPort: port,
LoggingLevel: os.Getenv("LOGGING_LEVEL"),
PostgresDSN: os.Getenv("POSTGRES_DSN"),
}
return config
}