refac: rethought the complete workflow and deployement flow ; docs etc.
This commit is contained in:
1 parent
4a6209a8db
commit
09bd5afa4a
26 files changed
+800
-334
No files matched your search
@@ -86,8 +86,18 @@ func getUseCases(repos *Repositories) *UseCases {
|
||||
}
|
||||
}
|
||||
|
||||
func InitContainer() *UseCases {
|
||||
func InitContainer() (*UseCases, func() error) {
|
||||
db := getDb()
|
||||
repos := getRepositories(db)
|
||||
return getUseCases(repos)
|
||||
return getUseCases(repos), closeDb(db)
|
||||
}
|
||||
|
||||
func closeDb(db *gorm.DB) func() error {
|
||||
return func() error {
|
||||
sqlDb, err := db.DB()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return sqlDb.Close()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user