feat: add notifications (#216)

* feat: initial notifications support

* chore: update deps
This commit is contained in:
Ludvig Lundgren 2022-04-04 19:13:09 +02:00 committed by GitHub
parent 3185832708
commit 431742fd94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1632 additions and 36 deletions

View file

@ -31,10 +31,11 @@ type Server struct {
filterService filterService
indexerService indexerService
ircService ircService
notificationService notificationService
releaseService releaseService
}
func NewServer(config domain.Config, sse *sse.Server, version string, commit string, date string, actionService actionService, authService authService, downloadClientSvc downloadClientService, filterSvc filterService, indexerSvc indexerService, ircSvc ircService, releaseSvc releaseService) Server {
func NewServer(config domain.Config, sse *sse.Server, version string, commit string, date string, actionService actionService, authService authService, downloadClientSvc downloadClientService, filterSvc filterService, indexerSvc indexerService, ircSvc ircService, notificationSvc notificationService, releaseSvc releaseService) Server {
return Server{
config: config,
sse: sse,
@ -50,6 +51,7 @@ func NewServer(config domain.Config, sse *sse.Server, version string, commit str
filterService: filterSvc,
indexerService: indexerSvc,
ircService: ircSvc,
notificationService: notificationSvc,
releaseService: releaseSvc,
}
}
@ -107,6 +109,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("/notification", newNotificationHandler(encoder, s.notificationService).Routes)
r.Route("/release", newReleaseHandler(encoder, s.releaseService).Routes)
r.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) {