init
This commit is contained in:
30
internal/adapters/config/config.go
Normal file
30
internal/adapters/config/config.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user