2020-06-05 17:42:01 +02:00
|
|
|
package caching
|
|
|
|
|
|
|
|
import "github.com/matrix-org/gomatrixserverlib"
|
|
|
|
|
|
|
|
// RoomVersionsCache contains the subset of functions needed for
|
|
|
|
// a room version cache.
|
|
|
|
type RoomVersionCache interface {
|
|
|
|
GetRoomVersion(roomID string) (roomVersion gomatrixserverlib.RoomVersion, ok bool)
|
|
|
|
StoreRoomVersion(roomID string, roomVersion gomatrixserverlib.RoomVersion)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c Caches) GetRoomVersion(roomID string) (gomatrixserverlib.RoomVersion, bool) {
|
2022-07-11 15:31:31 +02:00
|
|
|
return c.RoomVersions.Get(roomID)
|
2020-06-05 17:42:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c Caches) StoreRoomVersion(roomID string, roomVersion gomatrixserverlib.RoomVersion) {
|
|
|
|
c.RoomVersions.Set(roomID, roomVersion)
|
|
|
|
}
|