mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 03:31:41 +00:00
11d9b9db0e
This removes most of the code used for polylith/API mode. This removes the `/api` internal endpoints entirely. Binary size change roughly 5%: ``` 51437560 Feb 13 10:15 dendrite-monolith-server # old 48759008 Feb 13 10:15 dendrite-monolith-server # new ```
45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
package config
|
|
|
|
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:"in_memory"`
|
|
// Disable logging. This is mostly useful for unit tests.
|
|
NoLog bool `yaml:"-"`
|
|
// Disables TLS validation. This should NOT be used in production
|
|
DisableTLSValidation bool `yaml:"disable_tls_validation"`
|
|
}
|
|
|
|
func (c *JetStream) Prefixed(name string) string {
|
|
return fmt.Sprintf("%s%s", c.TopicPrefix, name)
|
|
}
|
|
|
|
func (c *JetStream) Durable(name string) string {
|
|
return c.Prefixed(name)
|
|
}
|
|
|
|
func (c *JetStream) Defaults(opts DefaultOpts) {
|
|
c.Addresses = []string{}
|
|
c.TopicPrefix = "Dendrite"
|
|
if opts.Generate {
|
|
c.StoragePath = Path("./")
|
|
c.NoLog = true
|
|
c.DisableTLSValidation = true
|
|
}
|
|
}
|
|
|
|
func (c *JetStream) Verify(configErrs *ConfigErrors) {}
|