db connect

This commit is contained in:
nquidox 2026-02-23 20:22:21 +03:00
parent a6be7a9e21
commit 1dce375512
6 changed files with 81 additions and 5 deletions

View file

@ -6,6 +6,7 @@ type Config struct {
App App
Http Http
TasksSource TasksSource
DBase DBase
}
type App struct {
@ -26,6 +27,14 @@ type TasksSource struct {
Timeout time.Duration
}
type DBase struct {
Host string
Port string
Username string
Password string
DBName string
}
func NewConfig() Config {
return Config{
App: App{
@ -45,5 +54,13 @@ func NewConfig() Config {
Port: getEnv("TASK_API_PORT", "61000"),
Timeout: getEnvSeconds("TASK_SOURCE_TIMEOUT_SECONDS", 60),
},
DBase: DBase{
Host: getEnv("DB_HOST", "10.0.0.4"),
Port: getEnv("DB_PORT", "54326"),
Username: getEnv("DB_USERNAME", "merch_app_user"),
Password: getEnv("DB_PASSWORD", "7kek8wait9"),
DBName: getEnv("DB_NAME", "merch_dev"),
},
}
}