Convert everything but serverkeyapi to inthttp (#1096)

* Convert roomserver to new inthttp format

* Convert eduserver to new inthttp format

* Convert appservice to new inthttp format
This commit is contained in:
Kegsay 2020-06-04 15:43:07 +01:00 committed by GitHub
parent d785ad82b9
commit 9834ac97db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 879 additions and 1013 deletions

View file

@ -23,6 +23,7 @@ import (
appserviceAPI "github.com/matrix-org/dendrite/appservice/api"
"github.com/matrix-org/dendrite/appservice/consumers"
"github.com/matrix-org/dendrite/appservice/inthttp"
"github.com/matrix-org/dendrite/appservice/query"
"github.com/matrix-org/dendrite/appservice/routing"
"github.com/matrix-org/dendrite/appservice/storage"
@ -77,14 +78,14 @@ func SetupAppServiceAPIComponent(
// Create appserivce query API with an HTTP client that will be used for all
// outbound and inbound requests (inbound only for the internal API)
appserviceQueryAPI := query.AppServiceQueryAPI{
appserviceQueryAPI := &query.AppServiceQueryAPI{
HTTPClient: &http.Client{
Timeout: time.Second * 30,
},
Cfg: base.Cfg,
}
appserviceQueryAPI.SetupHTTP(base.InternalAPIMux)
inthttp.AddRoutes(appserviceQueryAPI, base.InternalAPIMux)
consumer := consumers.NewOutputRoomEventConsumer(
base.Cfg, base.KafkaConsumer, accountsDB, appserviceDB,
@ -105,7 +106,7 @@ func SetupAppServiceAPIComponent(
accountsDB, federation, transactionsCache,
)
return &appserviceQueryAPI
return appserviceQueryAPI
}
// generateAppServiceAccounts creates a dummy account based off the