aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config_roomserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_roomserver.go')
-rw-r--r--internal/config/config_roomserver.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/config/config_roomserver.go b/internal/config/config_roomserver.go
new file mode 100644
index 00000000..1a16e2b1
--- /dev/null
+++ b/internal/config/config_roomserver.go
@@ -0,0 +1,23 @@
+package config
+
+type RoomServer struct {
+ Matrix *Global `yaml:"-"`
+
+ Listen Address `yaml:"listen"`
+ Bind Address `yaml:"bind"`
+
+ Database DatabaseOptions `yaml:"database"`
+}
+
+func (c *RoomServer) Defaults() {
+ c.Listen = "localhost:7770"
+ c.Bind = "localhost:7770"
+ c.Database.Defaults()
+ c.Database.ConnectionString = "file:roomserver.db"
+}
+
+func (c *RoomServer) Verify(configErrs *ConfigErrors, isMonolith bool) {
+ checkNotEmpty(configErrs, "room_server.listen", string(c.Listen))
+ checkNotEmpty(configErrs, "room_server.bind", string(c.Bind))
+ checkNotEmpty(configErrs, "room_server.database.connection_string", string(c.Database.ConnectionString))
+}