Refactor to downloader

This commit is contained in:
Ben Sarmiento
2024-01-08 23:17:03 +01:00
parent 5a23d0ff7b
commit 8a76cb0267
4 changed files with 26 additions and 24 deletions

View File

@@ -49,10 +49,10 @@ func MainApp(configPath string) {
torrentMgr := torrent.NewTorrentManager(config, rd, p, log.Named("manager"))
downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), 0, config, log.Named("dlclient"))
getfile := universal.NewGetFile(downloadClient)
downloader := universal.NewDownloader(downloadClient)
router := chi.NewRouter()
handlers.AttachHandlers(router, getfile, torrentMgr, config, rd, log.Named("router"))
handlers.AttachHandlers(router, downloader, torrentMgr, config, rd, log.Named("router"))
// go func() {
// if err := netHttp.ListenAndServe(":6060", nil); err != nil && err != netHttp.ErrServerClosed {