aboutsummaryrefslogtreecommitdiff
path: root/clientapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-03 17:17:02 +0100
committerGitHub <noreply@github.com>2022-05-03 17:17:02 +0100
commitdd061a172e97005a4a7a4c37db6caf3f77c10d51 (patch)
tree6603b4825a7c5c335b8b9041339ed2ddd7d91c56 /clientapi
parent4ad5f9c982fe5dc9e306a9269621ead8c31248cf (diff)
Tidy up `AddPublicRoutes` (#2412)
* Simplify federation API `AddPublicRoutes` * Simplify client API `AddPublicRoutes` * Simplify media API `AddPublicRoutes` * Simplify sync API `AddPublicRoutes` * Simplify `AddAllPublicRoutes`
Diffstat (limited to 'clientapi')
-rw-r--r--clientapi/clientapi.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/clientapi/clientapi.go b/clientapi/clientapi.go
index ad277056..0d16e4c1 100644
--- a/clientapi/clientapi.go
+++ b/clientapi/clientapi.go
@@ -15,7 +15,6 @@
package clientapi
import (
- "github.com/gorilla/mux"
appserviceAPI "github.com/matrix-org/dendrite/appservice/api"
"github.com/matrix-org/dendrite/clientapi/api"
"github.com/matrix-org/dendrite/clientapi/producers"
@@ -24,20 +23,15 @@ import (
"github.com/matrix-org/dendrite/internal/transactions"
keyserverAPI "github.com/matrix-org/dendrite/keyserver/api"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
- "github.com/matrix-org/dendrite/setup/config"
+ "github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/jetstream"
- "github.com/matrix-org/dendrite/setup/process"
userapi "github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/gomatrixserverlib"
)
// AddPublicRoutes sets up and registers HTTP handlers for the ClientAPI component.
func AddPublicRoutes(
- process *process.ProcessContext,
- router *mux.Router,
- synapseAdminRouter *mux.Router,
- dendriteAdminRouter *mux.Router,
- cfg *config.ClientAPI,
+ base *base.BaseDendrite,
federation *gomatrixserverlib.FederationClient,
rsAPI roomserverAPI.RoomserverInternalAPI,
asAPI appserviceAPI.AppServiceQueryAPI,
@@ -47,9 +41,10 @@ func AddPublicRoutes(
userDirectoryProvider userapi.UserDirectoryProvider,
keyAPI keyserverAPI.KeyInternalAPI,
extRoomsProvider api.ExtraPublicRoomsProvider,
- mscCfg *config.MSCs,
) {
- js, natsClient := jetstream.Prepare(process, &cfg.Matrix.JetStream)
+ cfg := &base.Cfg.ClientAPI
+ mscCfg := &base.Cfg.MSCs
+ js, natsClient := jetstream.Prepare(base.ProcessContext, &cfg.Matrix.JetStream)
syncProducer := &producers.SyncAPIProducer{
JetStream: js,
@@ -63,7 +58,9 @@ func AddPublicRoutes(
}
routing.Setup(
- router, synapseAdminRouter, dendriteAdminRouter,
+ base.PublicClientAPIMux,
+ base.SynapseAdminMux,
+ base.DendriteAdminMux,
cfg, rsAPI, asAPI,
userAPI, userDirectoryProvider, federation,
syncProducer, transactionsCache, fsAPI, keyAPI,