mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 01:13:10 -06:00
Review comments
This commit is contained in:
parent
dc7780af5c
commit
fca28dce85
|
|
@ -75,11 +75,11 @@ func main() {
|
||||||
log.Fatalf("Invalid config file: %s", err)
|
log.Fatalf("Invalid config file: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
m := monolith{cfg: cfg, api: mux.NewRouter()}
|
m := newMonolith(cfg)
|
||||||
m.setupDatabases()
|
m.setupDatabases()
|
||||||
|
m.setupFederation()
|
||||||
m.setupRoomServer()
|
m.setupRoomServer()
|
||||||
m.setupProducers()
|
m.setupProducers()
|
||||||
m.setupFederation()
|
|
||||||
m.setupNotifiers()
|
m.setupNotifiers()
|
||||||
m.setupConsumers()
|
m.setupConsumers()
|
||||||
m.setupAPIs()
|
m.setupAPIs()
|
||||||
|
|
@ -89,16 +89,12 @@ func main() {
|
||||||
log.Fatal(http.ListenAndServe(*httpBindAddr, nil))
|
log.Fatal(http.ListenAndServe(*httpBindAddr, nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A monolith contains all the dendrite components.
|
||||||
|
// Some of the setup functions depend on previous setup functions, so they must
|
||||||
|
// be called in the same order as they are defined in the file.
|
||||||
type monolith struct {
|
type monolith struct {
|
||||||
cfg *config.Dendrite
|
cfg *config.Dendrite
|
||||||
|
api *mux.Router
|
||||||
inputAPI *roomserver_input.RoomserverInputAPI
|
|
||||||
queryAPI *roomserver_query.RoomserverQueryAPI
|
|
||||||
aliasAPI *roomserver_alias.RoomserverAliasAPI
|
|
||||||
|
|
||||||
roomServerProducer *producers.RoomserverProducer
|
|
||||||
userUpdateProducer *producers.UserUpdateProducer
|
|
||||||
syncProducer *producers.SyncAPIProducer
|
|
||||||
|
|
||||||
roomServerDB *roomserver_storage.Database
|
roomServerDB *roomserver_storage.Database
|
||||||
accountDB *accounts.Database
|
accountDB *accounts.Database
|
||||||
|
|
@ -111,9 +107,19 @@ type monolith struct {
|
||||||
federation *gomatrixserverlib.FederationClient
|
federation *gomatrixserverlib.FederationClient
|
||||||
keyRing gomatrixserverlib.KeyRing
|
keyRing gomatrixserverlib.KeyRing
|
||||||
|
|
||||||
syncAPINotifier *syncapi_sync.Notifier
|
inputAPI *roomserver_input.RoomserverInputAPI
|
||||||
|
queryAPI *roomserver_query.RoomserverQueryAPI
|
||||||
|
aliasAPI *roomserver_alias.RoomserverAliasAPI
|
||||||
|
|
||||||
api *mux.Router
|
roomServerProducer *producers.RoomserverProducer
|
||||||
|
userUpdateProducer *producers.UserUpdateProducer
|
||||||
|
syncProducer *producers.SyncAPIProducer
|
||||||
|
|
||||||
|
syncAPINotifier *syncapi_sync.Notifier
|
||||||
|
}
|
||||||
|
|
||||||
|
func newMonolith(cfg *config.Dendrite) *monolith {
|
||||||
|
return &monolith{cfg: cfg, api: mux.NewRouter()}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *monolith) setupDatabases() {
|
func (m *monolith) setupDatabases() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue