Documentation ¶
Index ¶
- func ParseFlags()
- func ParseMonolithFlags()
- type BaseDendrite
- func (b *BaseDendrite) CheckDomainCfg()
- func (b *BaseDendrite) Close() error
- func (b *BaseDendrite) CreateAccountsDB() model.AccountsDatabase
- func (b *BaseDendrite) CreateApplicationServiceDB() model.AppServiceDatabase
- func (b *BaseDendrite) CreateDeviceDB() model.DeviceDatabase
- func (b *BaseDendrite) CreateEncryptApiDB() model.EncryptorAPIDatabase
- func (b *BaseDendrite) CreateFederationClient() *gomatrixserverlib.FederationClient
- func (b *BaseDendrite) CreateKeyDB() model.KeyDatabase
- func (b *BaseDendrite) CreatePresenceDB() model.PresenceDatabase
- func (b *BaseDendrite) CreatePublicRoomApiDB() model.PublicRoomAPIDatabase
- func (b *BaseDendrite) CreatePushApiDB() model.PushAPIDatabase
- func (b *BaseDendrite) CreateRoomDB() model.RoomServerDatabase
- func (b *BaseDendrite) CreateRsRPCCli(rpcCli *common.RpcClient) roomserverapi.RoomserverRPCAPI
- func (b *BaseDendrite) CreateServerConfDB() model.ConfigDatabase
- func (b *BaseDendrite) CreateSyncDB() model.SyncAPIDatabase
- func (b *BaseDendrite) PrepareCache() service.Cache
- func (b *BaseDendrite) SetupAndServeHTTP(addr string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFlags ¶
func ParseFlags()
ParseFlags parses the commandline flags and uses them to create a config. If running as a monolith use `ParseMonolithFlags` instead.
func ParseMonolithFlags ¶
func ParseMonolithFlags()
ParseMonolithFlags parses the commandline flags and uses them to create a config. Should only be used if running a monolith. See `ParseFlags`.
Types ¶
type BaseDendrite ¶
type BaseDendrite struct { ComponentName string // APIMux should be used to register new public matrix api endpoints APIMux *mux.Router Cfg *config.Dendrite RedisCache service.Cache // contains filtered or unexported fields }
BaseDendrite is a base for creating new instances of dendrite. It parses command line flags and config, and exposes methods for creating various resources. All errors are handled by logging then exiting, so all methods should only be used during start up. Must be closed when shutting down.
func NewBaseDendrite ¶
func NewBaseDendrite(cfg *config.Dendrite, componentName string) *BaseDendrite
NewBaseDendrite creates a new instance to be used by a component. The componentName is used for logging purposes, and should be a friendly name of the compontent running, e.g. "SyncAPI"
func (*BaseDendrite) CheckDomainCfg ¶
func (b *BaseDendrite) CheckDomainCfg()
func (*BaseDendrite) CreateAccountsDB ¶
func (b *BaseDendrite) CreateAccountsDB() model.AccountsDatabase
CreateAccountsDB creates a new instance of the accounts database. Should only be called once per component.
func (*BaseDendrite) CreateApplicationServiceDB ¶
func (b *BaseDendrite) CreateApplicationServiceDB() model.AppServiceDatabase
func (*BaseDendrite) CreateDeviceDB ¶
func (b *BaseDendrite) CreateDeviceDB() model.DeviceDatabase
CreateDeviceDB creates a new instance of the device database. Should only be called once per component.
func (*BaseDendrite) CreateEncryptApiDB ¶
func (b *BaseDendrite) CreateEncryptApiDB() model.EncryptorAPIDatabase
func (*BaseDendrite) CreateFederationClient ¶
func (b *BaseDendrite) CreateFederationClient() *gomatrixserverlib.FederationClient
CreateFederationClient creates a new federation client. Should only be called once per component.
func (*BaseDendrite) CreateKeyDB ¶
func (b *BaseDendrite) CreateKeyDB() model.KeyDatabase
CreateKeyDB creates a new instance of the key database. Should only be called once per component.
func (b *BaseDendrite) CreateKeyDB() *keydb.Database { db, err := keydb.NewDatabase(b.Cfg.Database.ServerKey.Driver, b.Cfg.Database.ServerKey.Addresses) if err != nil { log.Panicf("failed to connect to keys db err:%v", err) } return db }
func (*BaseDendrite) CreatePresenceDB ¶
func (b *BaseDendrite) CreatePresenceDB() model.PresenceDatabase
func (*BaseDendrite) CreatePublicRoomApiDB ¶
func (b *BaseDendrite) CreatePublicRoomApiDB() model.PublicRoomAPIDatabase
func (*BaseDendrite) CreatePushApiDB ¶
func (b *BaseDendrite) CreatePushApiDB() model.PushAPIDatabase
func (*BaseDendrite) CreateRoomDB ¶
func (b *BaseDendrite) CreateRoomDB() model.RoomServerDatabase
func (*BaseDendrite) CreateRsRPCCli ¶
func (b *BaseDendrite) CreateRsRPCCli(rpcCli *common.RpcClient) roomserverapi.RoomserverRPCAPI
CreateRsRPCCli returns the AliasAPI and QueryAPI to hit the roomserver over tcp.
func (*BaseDendrite) CreateServerConfDB ¶
func (b *BaseDendrite) CreateServerConfDB() model.ConfigDatabase
func (*BaseDendrite) CreateSyncDB ¶
func (b *BaseDendrite) CreateSyncDB() model.SyncAPIDatabase
func (*BaseDendrite) PrepareCache ¶
func (b *BaseDendrite) PrepareCache() service.Cache
func (*BaseDendrite) SetupAndServeHTTP ¶
func (b *BaseDendrite) SetupAndServeHTTP(addr string)
SetupAndServeHTTP sets up the HTTP server to serve endpoints registered on ApiMux under /api/ and adds a prometheus handler under /metrics.