Versions in this module Expand all Collapse all v0 v0.14.0 Dec 18, 2024 Changes in this version + type Database struct + Cache caching.RoomServerCaches + DB *sql.DB + GetRoomUpdaterFn func(ctx context.Context, roomInfo *types.RoomInfo) (*RoomUpdater, error) + InvitesTable tables.Invites + MembershipTable tables.Membership + PublishedTable tables.Published + Purge tables.Purge + RoomAliasesTable tables.RoomAliases + RoomsTable tables.Rooms + StateBlockTable tables.StateBlock + StateSnapshotTable tables.StateSnapshot + UserRoomKeyTable tables.UserRoomKeys + Writer sqlutil.Writer + func (d *Database) AddState(ctx context.Context, roomNID types.RoomNID, ...) (stateNID types.StateSnapshotNID, err error) + func (d *Database) AdminDeleteEventReport(ctx context.Context, reportID uint64) error + func (d *Database) AssignRoomNID(ctx context.Context, roomID spec.RoomID, ...) (roomNID types.RoomNID, err error) + func (d *Database) BulkSelectSnapshotsFromEventIDs(ctx context.Context, eventIDs []string) (map[types.StateSnapshotNID][]string, error) + func (d *Database) ForgetRoom(ctx context.Context, userID, roomID string, forget bool) error + func (d *Database) GetAliasesForRoomID(ctx context.Context, roomID string) ([]string, error) + func (d *Database) GetBulkStateContent(ctx context.Context, roomIDs []string, ...) ([]tables.StrippedEvent, error) + func (d *Database) GetCreatorIDForAlias(ctx context.Context, alias string) (string, error) + func (d *Database) GetHistoryVisibilityState(ctx context.Context, roomInfo *types.RoomInfo, eventID string, domain string) ([]gomatrixserverlib.PDU, error) + func (d *Database) GetInvitesForUser(ctx context.Context, roomNID types.RoomNID, ...) (senderUserIDs []types.EventStateKeyNID, eventIDs []string, ...) + func (d *Database) GetKnownUsers(ctx context.Context, userID, searchString string, limit int) ([]string, error) + func (d *Database) GetLeftUsers(ctx context.Context, userIDs []string) ([]string, error) + func (d *Database) GetLocalServerInRoom(ctx context.Context, roomNID types.RoomNID) (bool, error) + func (d *Database) GetMembership(ctx context.Context, roomNID types.RoomNID, requestSenderID spec.SenderID) (membershipEventNID types.EventNID, stillInRoom, isRoomforgotten bool, ...) + func (d *Database) GetMembershipEventNIDsForRoom(ctx context.Context, roomNID types.RoomNID, joinOnly bool, localOnly bool) ([]types.EventNID, error) + func (d *Database) GetMembershipForHistoryVisibility(ctx context.Context, userNID types.EventStateKeyNID, roomInfo *types.RoomInfo, ...) (map[string]*types.HeaderedEvent, error) + func (d *Database) GetOrCreateEventStateKeyNID(ctx context.Context, eventStateKey *string) (eventStateKeyNID types.EventStateKeyNID, err error) + func (d *Database) GetOrCreateEventTypeNID(ctx context.Context, eventType string) (eventTypeNID types.EventTypeNID, err error) + func (d *Database) GetOrCreateRoomInfo(ctx context.Context, event gomatrixserverlib.PDU) (roomInfo *types.RoomInfo, err error) + func (d *Database) GetPublishedRoom(ctx context.Context, roomID string) (bool, error) + func (d *Database) GetPublishedRooms(ctx context.Context, networkID string, includeAllNetworks bool) ([]string, error) + func (d *Database) GetRoomIDForAlias(ctx context.Context, alias string) (string, error) + func (d *Database) GetRoomUpdater(ctx context.Context, roomInfo *types.RoomInfo) (*RoomUpdater, error) + func (d *Database) GetRoomVersion(ctx context.Context, roomID string) (gomatrixserverlib.RoomVersion, error) + func (d *Database) GetRoomsByMembership(ctx context.Context, userID spec.UserID, membership string) ([]string, error) + func (d *Database) GetServerInRoom(ctx context.Context, roomNID types.RoomNID, serverName spec.ServerName) (bool, error) + func (d *Database) GetStateEvent(ctx context.Context, roomID, evType, stateKey string) (*types.HeaderedEvent, error) + func (d *Database) GetStateEventsWithEventType(ctx context.Context, roomID, evType string) ([]*types.HeaderedEvent, error) + func (d *Database) InsertReportedEvent(ctx context.Context, roomID, eventID, reportingUserID, reason string, ...) (int64, error) + func (d *Database) InsertUserRoomPrivatePublicKey(ctx context.Context, userID spec.UserID, roomID spec.RoomID, ...) (result ed25519.PrivateKey, err error) + func (d *Database) InsertUserRoomPublicKey(ctx context.Context, userID spec.UserID, roomID spec.RoomID, ...) (result ed25519.PublicKey, err error) + func (d *Database) IsEventRejected(ctx context.Context, roomNID types.RoomNID, eventID string) (bool, error) + func (d *Database) JoinedUsersSetInRooms(ctx context.Context, roomIDs, userIDs []string, localOnly bool) (map[string]int, error) + func (d *Database) LatestEventIDs(ctx context.Context, roomNID types.RoomNID) (references []string, currentStateSnapshotNID types.StateSnapshotNID, ...) + func (d *Database) MembershipUpdater(ctx context.Context, roomID, targetUserID string, targetLocal bool, ...) (*MembershipUpdater, error) + func (d *Database) MissingAuthPrevEvents(ctx context.Context, e gomatrixserverlib.PDU) (missingAuth, missingPrev []string, err error) + func (d *Database) PublishRoom(ctx context.Context, roomID, appserviceID, networkID string, publish bool) error + func (d *Database) PurgeRoom(ctx context.Context, roomID string) error + func (d *Database) QueryAdminEventReport(ctx context.Context, reportID uint64) (api.QueryAdminEventReportResponse, error) + func (d *Database) QueryAdminEventReports(ctx context.Context, from uint64, limit uint64, backwards bool, userID string, ...) ([]api.QueryAdminEventReportsResponse, int64, error) + func (d *Database) RemoveRoomAlias(ctx context.Context, alias string) error + func (d *Database) RoomInfo(ctx context.Context, roomID string) (*types.RoomInfo, error) + func (d *Database) RoomInfoByNID(ctx context.Context, roomNID types.RoomNID) (*types.RoomInfo, error) + func (d *Database) RoomsWithACLs(ctx context.Context) ([]string, error) + func (d *Database) SelectUserIDsForPublicKeys(ctx context.Context, publicKeys map[spec.RoomID][]ed25519.PublicKey) (result map[spec.RoomID]map[string]string, err error) + func (d *Database) SelectUserRoomPrivateKey(ctx context.Context, userID spec.UserID, roomID spec.RoomID) (key ed25519.PrivateKey, err error) + func (d *Database) SelectUserRoomPublicKey(ctx context.Context, userID spec.UserID, roomID spec.RoomID) (key ed25519.PublicKey, err error) + func (d *Database) SetRoomAlias(ctx context.Context, alias string, roomID string, creatorUserID string) error + func (d *Database) StateBlockNIDs(ctx context.Context, stateNIDs []types.StateSnapshotNID) ([]types.StateBlockNIDList, error) + func (d *Database) StateEntries(ctx context.Context, stateBlockNIDs []types.StateBlockNID) ([]types.StateEntryList, error) + func (d *Database) StateEntriesForTuples(ctx context.Context, stateBlockNIDs []types.StateBlockNID, ...) ([]types.StateEntryList, error) + func (d *Database) SupportsConcurrentRoomInputs() bool + func (d *Database) UpgradeRoom(ctx context.Context, oldRoomID, newRoomID, eventSender string) error + type EventDatabase struct + Cache caching.RoomServerCaches + DB *sql.DB + EventJSONTable tables.EventJSON + EventStateKeysTable tables.EventStateKeys + EventTypesTable tables.EventTypes + EventsTable tables.Events + PrevEventsTable tables.PreviousEvents + RedactionsTable tables.Redactions + ReportedEventsTable tables.ReportedEvents + Writer sqlutil.Writer + func (d *EventDatabase) EventIDs(ctx context.Context, eventNIDs []types.EventNID) (map[types.EventNID]string, error) + func (d *EventDatabase) EventNIDs(ctx context.Context, eventIDs []string) (map[string]types.EventMetadata, error) + func (d *EventDatabase) EventStateKeyNIDs(ctx context.Context, eventStateKeys []string) (map[string]types.EventStateKeyNID, error) + func (d *EventDatabase) EventStateKeys(ctx context.Context, eventStateKeyNIDs []types.EventStateKeyNID) (map[types.EventStateKeyNID]string, error) + func (d *EventDatabase) EventTypeNIDs(ctx context.Context, eventTypes []string) (map[string]types.EventTypeNID, error) + func (d *EventDatabase) Events(ctx context.Context, roomVersion gomatrixserverlib.RoomVersion, ...) ([]types.Event, error) + func (d *EventDatabase) EventsFromIDs(ctx context.Context, roomInfo *types.RoomInfo, eventIDs []string) ([]types.Event, error) + func (d *EventDatabase) MaybeRedactEvent(ctx context.Context, roomInfo *types.RoomInfo, eventNID types.EventNID, ...) (gomatrixserverlib.PDU, gomatrixserverlib.PDU, error) + func (d *EventDatabase) SetState(ctx context.Context, eventNID types.EventNID, stateNID types.StateSnapshotNID) error + func (d *EventDatabase) SnapshotNIDFromEventID(ctx context.Context, eventID string) (types.StateSnapshotNID, error) + func (d *EventDatabase) StateAtEventIDs(ctx context.Context, eventIDs []string) ([]types.StateAtEvent, error) + func (d *EventDatabase) StateEntriesForEventIDs(ctx context.Context, eventIDs []string, excludeRejected bool) ([]types.StateEntry, error) + func (d *EventDatabase) StoreEvent(ctx context.Context, event gomatrixserverlib.PDU, roomInfo *types.RoomInfo, ...) (types.EventNID, types.StateAtEvent, error) + type MembershipUpdater struct + func NewMembershipUpdater(ctx context.Context, d *Database, txn *sql.Tx, roomID, targetUserID string, ...) (*MembershipUpdater, error) + func (t *MembershipUpdater) Commit() error + func (t *MembershipUpdater) Rollback() error + func (u *MembershipUpdater) Delete() error + func (u *MembershipUpdater) IsInvite() bool + func (u *MembershipUpdater) IsJoin() bool + func (u *MembershipUpdater) IsKnock() bool + func (u *MembershipUpdater) IsLeave() bool + func (u *MembershipUpdater) Update(newMembership tables.MembershipState, event *types.Event) (bool, []string, error) + type RoomUpdater struct + func NewRoomUpdater(ctx context.Context, d *Database, txn *sql.Tx, roomInfo *types.RoomInfo) (*RoomUpdater, error) + func (u *RoomUpdater) AddState(ctx context.Context, roomNID types.RoomNID, ...) (stateNID types.StateSnapshotNID, err error) + func (u *RoomUpdater) BulkSelectSnapshotsFromEventIDs(ctx context.Context, eventIDs []string) (map[types.StateSnapshotNID][]string, error) + func (u *RoomUpdater) Commit() error + func (u *RoomUpdater) CurrentStateSnapshotNID() types.StateSnapshotNID + func (u *RoomUpdater) EventIDs(ctx context.Context, eventNIDs []types.EventNID) (map[types.EventNID]string, error) + func (u *RoomUpdater) EventStateKeyNIDs(ctx context.Context, eventStateKeys []string) (map[string]types.EventStateKeyNID, error) + func (u *RoomUpdater) EventTypeNIDs(ctx context.Context, eventTypes []string) (map[string]types.EventTypeNID, error) + func (u *RoomUpdater) Events(ctx context.Context, _ gomatrixserverlib.RoomVersion, ...) ([]types.Event, error) + func (u *RoomUpdater) EventsFromIDs(ctx context.Context, roomInfo *types.RoomInfo, eventIDs []string) ([]types.Event, error) + func (u *RoomUpdater) HasEventBeenSent(eventNID types.EventNID) (bool, error) + func (u *RoomUpdater) IsEventRejected(ctx context.Context, roomNID types.RoomNID, eventID string) (bool, error) + func (u *RoomUpdater) IsReferenced(eventID string) (bool, error) + func (u *RoomUpdater) LastEventIDSent() string + func (u *RoomUpdater) LatestEvents() []types.StateAtEventAndReference + func (u *RoomUpdater) MarkEventAsSent(eventNID types.EventNID) error + func (u *RoomUpdater) MembershipUpdater(targetUserNID types.EventStateKeyNID, targetLocal bool) (*MembershipUpdater, error) + func (u *RoomUpdater) Rollback() error + func (u *RoomUpdater) RoomExists() bool + func (u *RoomUpdater) RoomInfo(ctx context.Context, roomID string) (*types.RoomInfo, error) + func (u *RoomUpdater) RoomVersion() (version gomatrixserverlib.RoomVersion) + func (u *RoomUpdater) SetLatestEvents(roomNID types.RoomNID, latest []types.StateAtEventAndReference, ...) error + func (u *RoomUpdater) SetState(ctx context.Context, eventNID types.EventNID, stateNID types.StateSnapshotNID) error + func (u *RoomUpdater) SnapshotNIDFromEventID(ctx context.Context, eventID string) (types.StateSnapshotNID, error) + func (u *RoomUpdater) StateAtEventIDs(ctx context.Context, eventIDs []string) ([]types.StateAtEvent, error) + func (u *RoomUpdater) StateBlockNIDs(ctx context.Context, stateNIDs []types.StateSnapshotNID) ([]types.StateBlockNIDList, error) + func (u *RoomUpdater) StateEntries(ctx context.Context, stateBlockNIDs []types.StateBlockNID) ([]types.StateEntryList, error) + func (u *RoomUpdater) StateEntriesForTuples(ctx context.Context, stateBlockNIDs []types.StateBlockNID, ...) ([]types.StateEntryList, error) + type StatementList []struct + func (s StatementList) Prepare(db *sql.DB) (err error) + type UnsentFilter bool + const FilterUnsentOnly + const NoFilter