aboutsummaryrefslogtreecommitdiff
path: root/internal/setup/base.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/setup/base.go')
-rw-r--r--internal/setup/base.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/setup/base.go b/internal/setup/base.go
index 59bdfd2e..e287cfbd 100644
--- a/internal/setup/base.go
+++ b/internal/setup/base.go
@@ -46,6 +46,8 @@ import (
rsinthttp "github.com/matrix-org/dendrite/roomserver/inthttp"
serverKeyAPI "github.com/matrix-org/dendrite/serverkeyapi/api"
skinthttp "github.com/matrix-org/dendrite/serverkeyapi/inthttp"
+ userapi "github.com/matrix-org/dendrite/userapi/api"
+ userapiinthttp "github.com/matrix-org/dendrite/userapi/inthttp"
"github.com/sirupsen/logrus"
_ "net/http/pprof"
@@ -160,6 +162,15 @@ func (b *BaseDendrite) RoomserverHTTPClient() roomserverAPI.RoomserverInternalAP
return rsAPI
}
+// UserAPIClient returns UserInternalAPI for hitting the userapi over HTTP.
+func (b *BaseDendrite) UserAPIClient() userapi.UserInternalAPI {
+ userAPI, err := userapiinthttp.NewUserAPIClient(b.Cfg.UserAPIURL(), b.httpClient)
+ if err != nil {
+ logrus.WithError(err).Panic("UserAPIClient failed", b.httpClient)
+ }
+ return userAPI
+}
+
// EDUServerClient returns EDUServerInputAPI for hitting the EDU server over HTTP
func (b *BaseDendrite) EDUServerClient() eduServerAPI.EDUServerInputAPI {
e, err := eduinthttp.NewEDUServerClient(b.Cfg.EDUServerURL(), b.httpClient)