2020-08-10 08:18:04 -05:00
|
|
|
package config
|
|
|
|
|
|
|
|
type RoomServer struct {
|
|
|
|
Matrix *Global `yaml:"-"`
|
|
|
|
|
2020-08-13 06:16:37 -05:00
|
|
|
InternalAPI InternalAPIOptions `yaml:"internal_api"`
|
2020-08-10 08:18:04 -05:00
|
|
|
|
|
|
|
Database DatabaseOptions `yaml:"database"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *RoomServer) Defaults() {
|
2020-08-13 06:16:37 -05:00
|
|
|
c.InternalAPI.Listen = "http://localhost:7770"
|
|
|
|
c.InternalAPI.Connect = "http://localhost:7770"
|
2021-03-08 07:18:29 -06:00
|
|
|
c.Database.Defaults(10)
|
2020-08-10 08:18:04 -05:00
|
|
|
c.Database.ConnectionString = "file:roomserver.db"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *RoomServer) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
2020-08-13 06:16:37 -05:00
|
|
|
checkURL(configErrs, "room_server.internal_api.listen", string(c.InternalAPI.Listen))
|
|
|
|
checkURL(configErrs, "room_server.internal_ap.bind", string(c.InternalAPI.Connect))
|
2020-08-10 08:18:04 -05:00
|
|
|
checkNotEmpty(configErrs, "room_server.database.connection_string", string(c.Database.ConnectionString))
|
|
|
|
}
|