summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/init.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/init.go b/app/init.go
index 444d991..d26a962 100644
--- a/app/init.go
+++ b/app/init.go
@@ -12,6 +12,7 @@ import (
"github.com/xlgmokha/x/pkg/ioc"
"github.com/xlgmokha/x/pkg/log"
"github.com/xlgmokha/x/pkg/mapper"
+ "github.com/xlgmokha/x/pkg/x"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/dashboard"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/sparkles"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/db"
@@ -34,8 +35,15 @@ func init() {
ioc.Register[authz.CheckPermissionService](ioc.Default, func() authz.CheckPermissionService {
return ioc.MustResolve[*authzed.Client](ioc.Default)
})
+ ioc.RegisterSingleton[*event.Aggregator](ioc.Default, func() *event.Aggregator {
+ return x.New[*event.Aggregator](event.WithDefaults())
+ })
ioc.RegisterSingleton[domain.Repository[*domain.Sparkle]](ioc.Default, func() domain.Repository[*domain.Sparkle] {
- return db.NewRepository[*domain.Sparkle](event.New[*domain.Sparkle]())
+ return db.NewRepository[*domain.Sparkle](
+ x.New[*event.TypedAggregator[*domain.Sparkle]](event.WithAggregator[*domain.Sparkle](
+ ioc.MustResolve[*event.Aggregator](ioc.Default),
+ )),
+ )
})
ioc.RegisterSingleton[*http.ServeMux](ioc.Default, func() *http.ServeMux {
return http.NewServeMux()