diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-02-24 09:40:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-24 09:40:20 +0100 |
commit | ad07b169b8a58b5a843b7b19ff0a989399d0aea0 (patch) | |
tree | 8904e5e52ecec90aa94f748c10a08b08cdf01de1 /roomserver/internal/alias.go | |
parent | e6aa0955ff4113114ff8f30073582cc4ecc454fa (diff) |
Refactor `StoreEvent` and create a new `RoomDatabase` interface (#2985)
This PR changes a few things:
- It pulls out the creation of several NIDs from the `StoreEvent`
function to make the functions more reusable
- Uses more caching when using those NIDs to avoid DB round trips
Diffstat (limited to 'roomserver/internal/alias.go')
-rw-r--r-- | roomserver/internal/alias.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/roomserver/internal/alias.go b/roomserver/internal/alias.go index 329e6af7..fc61b7f4 100644 --- a/roomserver/internal/alias.go +++ b/roomserver/internal/alias.go @@ -30,26 +30,6 @@ import ( "github.com/tidwall/sjson" ) -// RoomserverInternalAPIDatabase has the storage APIs needed to implement the alias API. -type RoomserverInternalAPIDatabase interface { - // Save a given room alias with the room ID it refers to. - // Returns an error if there was a problem talking to the database. - SetRoomAlias(ctx context.Context, alias string, roomID string, creatorUserID string) error - // Look up the room ID a given alias refers to. - // Returns an error if there was a problem talking to the database. - GetRoomIDForAlias(ctx context.Context, alias string) (string, error) - // Look up all aliases referring to a given room ID. - // Returns an error if there was a problem talking to the database. - GetAliasesForRoomID(ctx context.Context, roomID string) ([]string, error) - // Remove a given room alias. - // Returns an error if there was a problem talking to the database. - RemoveRoomAlias(ctx context.Context, alias string) error - // Look up the room version for a given room. - GetRoomVersionForRoom( - ctx context.Context, roomID string, - ) (gomatrixserverlib.RoomVersion, error) -} - // SetRoomAlias implements alias.RoomserverInternalAPI func (r *RoomserverInternalAPI) SetRoomAlias( ctx context.Context, |