Documentation ¶
Index ¶
- func NewDatabase(driver, createAddr, address, underlying, topic string, useAsync bool) (interface{}, error)
- type Database
- func (d *Database) CountPublicRooms(ctx context.Context) (int64, error)
- func (d *Database) GetPublicRooms(ctx context.Context, offset int64, limit int64, filter string) ([]publicroomstypes.PublicRoom, error)
- func (d *Database) OnDecrementJoinedMembersInRoom(ctx context.Context, roomID string) error
- func (d *Database) OnIncrementJoinedMembersInRoom(ctx context.Context, roomID string) error
- func (d *Database) OnInsertNewRoom(ctx context.Context, roomID string, seqID, joinedMembers int64, ...) error
- func (d *Database) OnUpdateRoomAttribute(ctx context.Context, attrName string, attrValue interface{}, roomID string) error
- func (d *Database) SetGauge(qryDBGauge mon.LabeledGauge)
- func (d *Database) SetIDGenerator(idg *uid.UidGenerator)
- func (d *Database) UpdateRoomFromEvent(ctx context.Context, event gomatrixserverlib.ClientEvent) error
- func (d *Database) WriteDBEvent(ctx context.Context, update *dbtypes.DBEvent) error
- func (d *Database) WriteDBEventWithTbl(ctx context.Context, update *dbtypes.DBEvent, tbl string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabase ¶
func NewDatabase(driver, createAddr, address, underlying, topic string, useAsync bool) (interface{}, error)
NewDatabase creates a new public rooms server database.
Types ¶
type Database ¶
type Database struct { AsyncSave bool // contains filtered or unexported fields }
Database represents a public rooms server database.
func (*Database) CountPublicRooms ¶
CountPublicRooms returns the number of room set as publicly visible on the server. Returns an error if the retrieval failed.
func (*Database) GetPublicRooms ¶
func (d *Database) GetPublicRooms( ctx context.Context, offset int64, limit int64, filter string, ) ([]publicroomstypes.PublicRoom, error)
GetPublicRooms returns an array containing the local rooms set as publicly visible, ordered by their number of joined members. This array can be limited by a given number of elements, and offset by a given value. If the limit is 0, doesn't limit the number of results. If the offset is 0 too, the array contains all the rooms set as publicly visible on the server. Returns an error if the retrieval failed.
func (*Database) OnDecrementJoinedMembersInRoom ¶
func (*Database) OnIncrementJoinedMembersInRoom ¶
func (*Database) OnInsertNewRoom ¶
func (*Database) OnUpdateRoomAttribute ¶
func (*Database) SetGauge ¶
func (d *Database) SetGauge(qryDBGauge mon.LabeledGauge)
func (*Database) SetIDGenerator ¶
func (d *Database) SetIDGenerator(idg *uid.UidGenerator)
func (*Database) UpdateRoomFromEvent ¶
func (d *Database) UpdateRoomFromEvent( ctx context.Context, event gomatrixserverlib.ClientEvent, ) error
func (*Database) WriteDBEvent ¶
WriteOutputEvents implements OutputRoomEventWriter