Skip to content

Commit 8418f86

Browse files
committed
feat: initialize history manager in main
- Added history manager to config
1 parent 82c0436 commit 8418f86

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/maniac-en/req/internal/collections"
1515
"github.com/maniac-en/req/internal/database"
16+
"github.com/maniac-en/req/internal/history"
1617
"github.com/maniac-en/req/internal/http"
1718
"github.com/maniac-en/req/internal/log"
1819
_ "github.com/mattn/go-sqlite3"
@@ -36,6 +37,7 @@ type Config struct {
3637
DB *database.Queries
3738
Collections *collections.CollectionsManager
3839
HTTP *http.HTTPManager
40+
History *history.HistoryManager
3941
}
4042

4143
func initPaths() error {
@@ -130,14 +132,16 @@ func main() {
130132
db := database.New(DB)
131133
collectionsManager := collections.NewCollectionsManager(db)
132134
httpManager := http.NewHTTPManager()
135+
historyManager := history.NewHistoryManager(db)
133136

134137
config := &Config{
135138
DB: db,
136139
Collections: collectionsManager,
137140
HTTP: httpManager,
141+
History: historyManager,
138142
}
139143

140-
log.Info("application initialized", "components", []string{"database", "collections", "http", "logging"})
141-
log.Debug("configuration loaded", "collections_manager", config.Collections != nil, "database", config.DB != nil, "http_manager", config.HTTP != nil)
144+
log.Info("application initialized", "components", []string{"database", "collections", "http", "history", "logging"})
145+
log.Debug("configuration loaded", "collections_manager", config.Collections != nil, "database", config.DB != nil, "http_manager", config.HTTP != nil, "history_manager", config.History != nil)
142146
log.Info("application started successfully")
143147
}

0 commit comments

Comments
 (0)