Files
yt-dlp-web-ui/server/archive/provider.go
T
Marco Piovanello 143cc28a97 Server v4 (#370)
* refactoring-1

introduced pipelines and abstracted download process.go in Downloader interface

* migrated to boltdb from sqlite + session files

* refactoring: config struct & pipelines

* added js runtime for yt-dlp

* updated dockerfile

* added external js runtime, metadata scraping refactor

* updated Dockerfile

* fixed env propagation in docker

* updated package name to v4

* updated readme and cd
2026-06-29 19:01:53 +02:00

43 lines
840 B
Go

package archive
import (
"database/sql"
"sync"
"github.com/marcopiovanello/yt-dlp-web-ui/v4/server/archive/domain"
"github.com/marcopiovanello/yt-dlp-web-ui/v4/server/archive/repository"
"github.com/marcopiovanello/yt-dlp-web-ui/v4/server/archive/rest"
"github.com/marcopiovanello/yt-dlp-web-ui/v4/server/archive/service"
)
var (
repo domain.Repository
svc domain.Service
hand domain.RestHandler
repoOnce sync.Once
svcOnce sync.Once
handOnce sync.Once
)
func provideRepository(db *sql.DB) domain.Repository {
repoOnce.Do(func() {
repo = repository.New(db)
})
return repo
}
func provideService(r domain.Repository) domain.Service {
svcOnce.Do(func() {
svc = service.New(r)
})
return svc
}
func provideHandler(s domain.Service) domain.RestHandler {
handOnce.Do(func() {
hand = rest.New(s)
})
return hand
}