Files
gerald/internal/adapters/config/config.go
2024-04-20 16:45:56 +03:00

31 lines
481 B
Go

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
}