publicroomapi

package
v0.0.0-...-a79a434 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2020 License: AGPL-3.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

func (d *Database) CountPublicRooms(ctx context.Context) (int64, error)

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 (d *Database) OnDecrementJoinedMembersInRoom(
	ctx context.Context, roomID string,
) error

func (*Database) OnIncrementJoinedMembersInRoom

func (d *Database) OnIncrementJoinedMembersInRoom(
	ctx context.Context, roomID string,
) error

func (*Database) OnInsertNewRoom

func (d *Database) OnInsertNewRoom(
	ctx context.Context,
	roomID string,
	seqID,
	joinedMembers int64,
	aliases []string,
	canonicalAlias,
	name,
	topic string,
	worldReadable,
	guestCanJoin bool,
	avatarUrl string,
	visibility bool,
) error

func (*Database) OnUpdateRoomAttribute

func (d *Database) OnUpdateRoomAttribute(
	ctx context.Context, attrName string, attrValue interface{}, roomID string,
) error

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

func (d *Database) WriteDBEvent(ctx context.Context, update *dbtypes.DBEvent) error

WriteOutputEvents implements OutputRoomEventWriter

func (*Database) WriteDBEventWithTbl

func (d *Database) WriteDBEventWithTbl(ctx context.Context, update *dbtypes.DBEvent, tbl string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL