Glue together devices and auth with the current HTTP code (#117)

- Renamed `clientapi/auth/types` to `clientapi/auth/authtypes` for the same
  horrible namespace clashing reasons as `storage`.
- Factored out `makeAPI` to `common`.
- Added in `makeAuthAPI`.
This commit is contained in:
Kegsay 2017-05-23 17:43:05 +01:00 committed by GitHub
parent 309300a744
commit 3b9222e8f7
16 changed files with 130 additions and 87 deletions

View file

@ -20,6 +20,7 @@ import (
"strings"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
"github.com/matrix-org/dendrite/clientapi/config"
"github.com/matrix-org/dendrite/clientapi/producers"
"github.com/matrix-org/dendrite/clientapi/routing"
@ -85,7 +86,11 @@ func main() {
if err != nil {
log.Panicf("Failed to setup account database(%s): %s", accountDataSource, err.Error())
}
deviceDB, err := devices.NewDatabase(accountDataSource)
if err != nil {
log.Panicf("Failed to setup device database(%s): %s", accountDataSource, err.Error())
}
routing.Setup(http.DefaultServeMux, http.DefaultClient, cfg, roomserverProducer, queryAPI, accountDB)
routing.Setup(http.DefaultServeMux, http.DefaultClient, cfg, roomserverProducer, queryAPI, accountDB, deviceDB)
log.Fatal(http.ListenAndServe(bindAddr, nil))
}