mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 11:53:09 -06:00
The general idea here is to have the wasm build have a `NewXXXDatabase` that doesn't import any postgres package and hence we never import `lib/pq`, which doesn't work under WASM (undefined `userCurrent`).
20 lines
746 B
Go
20 lines
746 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/matrix-org/dendrite/common"
|
|
"github.com/matrix-org/dendrite/publicroomsapi/types"
|
|
"github.com/matrix-org/gomatrixserverlib"
|
|
)
|
|
|
|
type Database interface {
|
|
common.PartitionStorer
|
|
GetRoomVisibility(ctx context.Context, roomID string) (bool, error)
|
|
SetRoomVisibility(ctx context.Context, visible bool, roomID string) error
|
|
CountPublicRooms(ctx context.Context) (int64, error)
|
|
GetPublicRooms(ctx context.Context, offset int64, limit int16, filter string) ([]types.PublicRoom, error)
|
|
UpdateRoomFromEvents(ctx context.Context, eventsToAdd []gomatrixserverlib.Event, eventsToRemove []gomatrixserverlib.Event) error
|
|
UpdateRoomFromEvent(ctx context.Context, event gomatrixserverlib.Event) error
|
|
}
|