aboutsummaryrefslogtreecommitdiff
path: root/mediaapi
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-06-08 15:51:07 +0100
committerGitHub <noreply@github.com>2020-06-08 15:51:07 +0100
commit4f171c56a832c836b0eb21650ee84d56e451dd6a (patch)
treee92059f1dbb784c978b60897d6ac13983d51c1b4 /mediaapi
parentcdb9a115715bd5a9e84df5bc95060e2dac1f6d89 (diff)
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
Diffstat (limited to 'mediaapi')
-rw-r--r--mediaapi/mediaapi.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/mediaapi/mediaapi.go b/mediaapi/mediaapi.go
index b5bec390..d4e260ea 100644
--- a/mediaapi/mediaapi.go
+++ b/mediaapi/mediaapi.go
@@ -15,26 +15,26 @@
package mediaapi
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/internal/config"
"github.com/matrix-org/dendrite/mediaapi/routing"
"github.com/matrix-org/dendrite/mediaapi/storage"
"github.com/matrix-org/gomatrixserverlib"
"github.com/sirupsen/logrus"
)
-// SetupMediaAPIComponent sets up and registers HTTP handlers for the MediaAPI
-// component.
-func SetupMediaAPIComponent(
- base *basecomponent.BaseDendrite,
+// AddPublicRoutes sets up and registers HTTP handlers for the MediaAPI component.
+func AddPublicRoutes(
+ router *mux.Router, cfg *config.Dendrite,
deviceDB devices.Database,
) {
- mediaDB, err := storage.Open(string(base.Cfg.Database.MediaAPI), base.Cfg.DbProperties())
+ mediaDB, err := storage.Open(string(cfg.Database.MediaAPI), cfg.DbProperties())
if err != nil {
logrus.WithError(err).Panicf("failed to connect to media db")
}
routing.Setup(
- base.PublicAPIMux, base.Cfg, mediaDB, deviceDB, gomatrixserverlib.NewClient(),
+ router, cfg, mediaDB, deviceDB, gomatrixserverlib.NewClient(),
)
}