feat: refactor configuration to include source and target database types
This commit is contained in:
@@ -8,10 +8,8 @@ import (
|
||||
)
|
||||
|
||||
type appConfig struct {
|
||||
SourceDbUrl string
|
||||
SourceDbType string
|
||||
TargetDbUrl string
|
||||
TargetDbType string
|
||||
SourceDbUrl string
|
||||
TargetDbUrl string
|
||||
}
|
||||
|
||||
func loadEnv() {
|
||||
@@ -29,26 +27,14 @@ func getAppConfig() appConfig {
|
||||
log.Fatal("SOURCE_DB_URL environment variable not set")
|
||||
}
|
||||
|
||||
sourceDbType := os.Getenv("SOURCE_DB_TYPE")
|
||||
if sourceDbType == "" {
|
||||
log.Fatal("SOURCE_DB_TYPE environment variable not set")
|
||||
}
|
||||
|
||||
targetDbUrl := os.Getenv("TARGET_DB_URL")
|
||||
if targetDbUrl == "" {
|
||||
log.Fatal("TARGET_DB_URL environment variable not set")
|
||||
}
|
||||
|
||||
targetDbType := os.Getenv("TARGET_DB_TYPE")
|
||||
if targetDbType == "" {
|
||||
log.Fatal("TARGET_DB_TYPE environment variable not set")
|
||||
}
|
||||
|
||||
return appConfig{
|
||||
SourceDbUrl: sourceDbUrl,
|
||||
SourceDbType: sourceDbType,
|
||||
TargetDbUrl: targetDbUrl,
|
||||
TargetDbType: targetDbType,
|
||||
SourceDbUrl: sourceDbUrl,
|
||||
TargetDbUrl: targetDbUrl,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user