mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Various other refactoring
This commit is contained in:
parent
8f40e8fd5e
commit
48322bc2b2
12 changed files with 25 additions and 16 deletions
|
@ -296,6 +296,8 @@ func (config *Dendrite) Derive() error {
|
|||
func (c *Dendrite) Defaults() {
|
||||
c.Version = 1
|
||||
|
||||
c.Wiring()
|
||||
|
||||
c.Global.Defaults()
|
||||
c.ClientAPI.Defaults()
|
||||
c.EDUServer.Defaults()
|
||||
|
@ -309,8 +311,6 @@ func (c *Dendrite) Defaults() {
|
|||
c.UserAPI.Defaults()
|
||||
c.AppServiceAPI.Defaults()
|
||||
c.MSCs.Defaults()
|
||||
|
||||
c.Wiring()
|
||||
}
|
||||
|
||||
func (c *Dendrite) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
|
|
|
@ -5,21 +5,26 @@ import "fmt"
|
|||
type JetStream struct {
|
||||
Matrix *Global `yaml:"-"`
|
||||
|
||||
// Persistent directory to store JetStream streams in.
|
||||
StoragePath Path `yaml:"storage_path"`
|
||||
// A list of NATS addresses to connect to. If none are specified, an
|
||||
// internal NATS server will be used when running in monolith mode only.
|
||||
Addresses []string `yaml:"addresses"`
|
||||
// The prefix to use for stream names for this homeserver - really only
|
||||
// useful if running more than one Dendrite on the same NATS deployment.
|
||||
TopicPrefix string `yaml:"topic_prefix"`
|
||||
// Keep all storage in memory. This is mostly useful for unit tests.
|
||||
InMemory bool `yaml:"-"`
|
||||
}
|
||||
|
||||
func (k *JetStream) TopicFor(name string) string {
|
||||
return fmt.Sprintf("%s%s", k.TopicPrefix, name)
|
||||
func (c *JetStream) TopicFor(name string) string {
|
||||
return fmt.Sprintf("%s%s", c.TopicPrefix, name)
|
||||
}
|
||||
|
||||
func (c *JetStream) Defaults() {
|
||||
c.Addresses = []string{}
|
||||
c.TopicPrefix = "Dendrite"
|
||||
c.StoragePath = Path(fmt.Sprintf("./%s", c.Matrix.ServerName))
|
||||
}
|
||||
|
||||
func (c *JetStream) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue