db connect
This commit is contained in:
parent
a6be7a9e21
commit
1dce375512
6 changed files with 81 additions and 5 deletions
|
|
@ -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"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue