aboutsummaryrefslogtreecommitdiff
path: root/setup/monolith.go
diff options
context:
space:
mode:
Diffstat (limited to 'setup/monolith.go')
-rw-r--r--setup/monolith.go27
1 files changed, 19 insertions, 8 deletions
diff --git a/setup/monolith.go b/setup/monolith.go
index 174eba68..51e40070 100644
--- a/setup/monolith.go
+++ b/setup/monolith.go
@@ -21,13 +21,16 @@ import (
"github.com/matrix-org/dendrite/federationapi"
federationAPI "github.com/matrix-org/dendrite/federationapi/api"
"github.com/matrix-org/dendrite/internal/caching"
+ "github.com/matrix-org/dendrite/internal/httputil"
+ "github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/internal/transactions"
"github.com/matrix-org/dendrite/mediaapi"
"github.com/matrix-org/dendrite/relayapi"
relayAPI "github.com/matrix-org/dendrite/relayapi/api"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
- "github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/config"
+ "github.com/matrix-org/dendrite/setup/jetstream"
+ "github.com/matrix-org/dendrite/setup/process"
"github.com/matrix-org/dendrite/syncapi"
userapi "github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/gomatrixserverlib"
@@ -53,23 +56,31 @@ type Monolith struct {
}
// AddAllPublicRoutes attaches all public paths to the given router
-func (m *Monolith) AddAllPublicRoutes(base *base.BaseDendrite, caches *caching.Caches) {
+func (m *Monolith) AddAllPublicRoutes(
+ processCtx *process.ProcessContext,
+ cfg *config.Dendrite,
+ routers httputil.Routers,
+ cm sqlutil.Connections,
+ natsInstance *jetstream.NATSInstance,
+ caches *caching.Caches,
+ enableMetrics bool,
+) {
userDirectoryProvider := m.ExtUserDirectoryProvider
if userDirectoryProvider == nil {
userDirectoryProvider = m.UserAPI
}
clientapi.AddPublicRoutes(
- base, m.FedClient, m.RoomserverAPI, m.AppserviceAPI, transactions.New(),
+ processCtx, routers, cfg, natsInstance, m.FedClient, m.RoomserverAPI, m.AppserviceAPI, transactions.New(),
m.FederationAPI, m.UserAPI, userDirectoryProvider,
- m.ExtPublicRoomsProvider,
+ m.ExtPublicRoomsProvider, enableMetrics,
)
federationapi.AddPublicRoutes(
- base, m.UserAPI, m.FedClient, m.KeyRing, m.RoomserverAPI, m.FederationAPI, nil,
+ processCtx, routers, cfg, natsInstance, m.UserAPI, m.FedClient, m.KeyRing, m.RoomserverAPI, m.FederationAPI, nil, enableMetrics,
)
- mediaapi.AddPublicRoutes(base, m.UserAPI, m.Client)
- syncapi.AddPublicRoutes(base, m.UserAPI, m.RoomserverAPI, caches)
+ mediaapi.AddPublicRoutes(routers.Media, cm, cfg, m.UserAPI, m.Client)
+ syncapi.AddPublicRoutes(processCtx, routers, cfg, cm, natsInstance, m.UserAPI, m.RoomserverAPI, caches, enableMetrics)
if m.RelayAPI != nil {
- relayapi.AddPublicRoutes(base, m.KeyRing, m.RelayAPI)
+ relayapi.AddPublicRoutes(routers, cfg, m.KeyRing, m.RelayAPI)
}
}