Feature: Save releases (#36)

* chore: tidy deps

* refactor: database migration

* refactor: store release

* refactor: save release

* chore: add packages

* feat(web): show stats and recent releases

* refactor: simply filter struct

* feat: add eventbus

* chore: cleanup logging

* chore: update packages
This commit is contained in:
Ludvig Lundgren 2021-11-24 23:18:12 +01:00 committed by GitHub
parent d22dd2fe84
commit 7177e48c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 5859 additions and 3328 deletions

View file

@ -25,9 +25,10 @@ type Server struct {
filterService filterService
indexerService indexerService
ircService ircService
releaseService releaseService
}
func NewServer(sse *sse.Server, address string, baseUrl string, actionService actionService, authService authService, downloadClientSvc downloadClientService, filterSvc filterService, indexerSvc indexerService, ircSvc ircService) Server {
func NewServer(sse *sse.Server, address string, baseUrl string, actionService actionService, authService authService, downloadClientSvc downloadClientService, filterSvc filterService, indexerSvc indexerService, ircSvc ircService, releaseSvc releaseService) Server {
return Server{
sse: sse,
address: address,
@ -39,6 +40,7 @@ func NewServer(sse *sse.Server, address string, baseUrl string, actionService ac
filterService: filterSvc,
indexerService: indexerSvc,
ircService: ircSvc,
releaseService: releaseSvc,
}
}
@ -94,6 +96,7 @@ func (s Server) Handler() http.Handler {
r.Route("/filters", newFilterHandler(encoder, s.filterService).Routes)
r.Route("/irc", newIrcHandler(encoder, s.ircService).Routes)
r.Route("/indexer", newIndexerHandler(encoder, s.indexerService, s.ircService).Routes)
r.Route("/release", newReleaseHandler(encoder, s.releaseService).Routes)
r.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) {
@ -105,7 +108,7 @@ func (s Server) Handler() http.Handler {
"X-Accel-Buffering": "no",
}
s.sse.HTTPHandler(w, r)
s.sse.ServeHTTP(w, r)
})
})
})