mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
Clean up interface definitions (#2427)
* tidy up interfaces * remove unused GetCreatorIDForAlias * Add RoomserverUserAPI interface * Define more interfaces * Use AppServiceInternalAPI for consistent naming * clean up federationapi constructor a bit * Fix monolith in -http mode
This commit is contained in:
parent
4705f5761e
commit
85704eff20
37 changed files with 236 additions and 429 deletions
|
@ -50,8 +50,8 @@ func AddPublicRoutes(
|
|||
federation *gomatrixserverlib.FederationClient,
|
||||
keyRing gomatrixserverlib.JSONVerifier,
|
||||
rsAPI roomserverAPI.FederationRoomserverAPI,
|
||||
federationAPI federationAPI.FederationInternalAPI,
|
||||
keyAPI keyserverAPI.KeyInternalAPI,
|
||||
fedAPI federationAPI.FederationInternalAPI,
|
||||
keyAPI keyserverAPI.FederationKeyAPI,
|
||||
servers federationAPI.ServersInRoomProvider,
|
||||
) {
|
||||
cfg := &base.Cfg.FederationAPI
|
||||
|
@ -67,12 +67,23 @@ func AddPublicRoutes(
|
|||
UserAPI: userAPI,
|
||||
}
|
||||
|
||||
// the federationapi component is a bit unique in that it attaches public routes AND serves
|
||||
// internal APIs (because it used to be 2 components: the 2nd being fedsender). As a result,
|
||||
// the constructor shape is a bit wonky in that it is not valid to AddPublicRoutes without a
|
||||
// concrete impl of FederationInternalAPI as the public routes and the internal API _should_
|
||||
// be the same thing now.
|
||||
f, ok := fedAPI.(*internal.FederationInternalAPI)
|
||||
if !ok {
|
||||
panic("federationapi.AddPublicRoutes called with a FederationInternalAPI impl which was not " +
|
||||
"FederationInternalAPI. This is a programming error.")
|
||||
}
|
||||
|
||||
routing.Setup(
|
||||
base.PublicFederationAPIMux,
|
||||
base.PublicKeyAPIMux,
|
||||
base.PublicWellKnownAPIMux,
|
||||
cfg,
|
||||
rsAPI, federationAPI, keyRing,
|
||||
rsAPI, f, keyRing,
|
||||
federation, userAPI, keyAPI, mscCfg,
|
||||
servers, producer,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue