aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config_syncapi.go
blob: 488f6658da843f688d691183ee996a6f4312d0b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package config

type SyncAPI struct {
	Matrix *Global `yaml:"-"`

	Listen Address `yaml:"listen"`
	Bind   Address `yaml:"bind"`

	Database DatabaseOptions `yaml:"database"`
}

func (c *SyncAPI) Defaults() {
	c.Listen = "localhost:7773"
	c.Bind = "localhost:7773"
	c.Database.Defaults()
	c.Database.ConnectionString = "file:syncapi.db"
}

func (c *SyncAPI) Verify(configErrs *ConfigErrors, isMonolith bool) {
	checkNotEmpty(configErrs, "sync_api.listen", string(c.Listen))
	checkNotEmpty(configErrs, "sync_api.bind", string(c.Bind))
	checkNotEmpty(configErrs, "sync_api.database", string(c.Database.ConnectionString))
}