mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 21:32:46 +00:00
Split out SetupFooComponent (#1106)
* Split out adding HTTP routes from making internal APIs for clarity * Split out more components * Split out more things * Finish converting * internal mux for internal routes
This commit is contained in:
parent
cdb9a11571
commit
4f171c56a8
25 changed files with 171 additions and 138 deletions
|
@ -15,6 +15,7 @@
|
|||
package publicroomsapi
|
||||
|
||||
import (
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
|
||||
"github.com/matrix-org/dendrite/internal/basecomponent"
|
||||
"github.com/matrix-org/dendrite/publicroomsapi/consumers"
|
||||
|
@ -26,9 +27,10 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// SetupPublicRoomsAPIComponent sets up and registers HTTP handlers for the PublicRoomsAPI
|
||||
// AddPublicRoutes sets up and registers HTTP handlers for the PublicRoomsAPI
|
||||
// component.
|
||||
func SetupPublicRoomsAPIComponent(
|
||||
func AddPublicRoutes(
|
||||
router *mux.Router,
|
||||
base *basecomponent.BaseDendrite,
|
||||
deviceDB devices.Database,
|
||||
publicRoomsDB storage.Database,
|
||||
|
@ -43,5 +45,5 @@ func SetupPublicRoomsAPIComponent(
|
|||
logrus.WithError(err).Panic("failed to start public rooms server consumer")
|
||||
}
|
||||
|
||||
routing.Setup(base.PublicAPIMux, deviceDB, publicRoomsDB, rsAPI, fedClient, extRoomsProvider)
|
||||
routing.Setup(router, deviceDB, publicRoomsDB, rsAPI, fedClient, extRoomsProvider)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue