experimental

This commit is contained in:
Mukhtar Akere
2025-03-15 21:08:15 +01:00
parent b4e4db27fb
commit 2d29996d2c
11 changed files with 281 additions and 127 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/sirrobot01/debrid-blackhole/pkg/service"
"github.com/sirrobot01/debrid-blackhole/pkg/version"
"github.com/sirrobot01/debrid-blackhole/pkg/web"
"github.com/sirrobot01/debrid-blackhole/pkg/webdav"
"github.com/sirrobot01/debrid-blackhole/pkg/worker"
"runtime/debug"
"sync"
@@ -30,12 +31,16 @@ func Start(ctx context.Context) error {
svc := service.New()
_qbit := qbit.New()
srv := server.New()
webRoutes := web.New(_qbit).Routes()
_webdav := webdav.New()
ui := web.New(_qbit).Routes()
webdavRoutes := _webdav.Routes()
qbitRoutes := _qbit.Routes()
// Register routes
srv.Mount("/", webRoutes)
srv.Mount("/", ui)
srv.Mount("/api/v2", qbitRoutes)
srv.Mount("/webdav", webdavRoutes)
safeGo := func(f func() error) {
wg.Add(1)
@@ -66,6 +71,10 @@ func Start(ctx context.Context) error {
})
}
safeGo(func() error {
return _webdav.Start(ctx)
})
safeGo(func() error {
return srv.Start(ctx)
})