0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-15 18:53:43 +01:00
dendrite/internal/caching/cache_roomservernids.go
2022-07-19 12:15:48 +01:00

28 lines
710 B
Go

package caching
import (
"github.com/matrix-org/dendrite/roomserver/types"
)
type RoomServerCaches interface {
RoomServerNIDsCache
RoomVersionCache
RoomInfoCache
RoomServerEventsCache
EventStateKeyCache
}
// RoomServerNIDsCache contains the subset of functions needed for
// a roomserver NID cache.
type RoomServerNIDsCache interface {
GetRoomServerRoomID(roomNID types.RoomNID) (string, bool)
StoreRoomServerRoomID(roomNID types.RoomNID, roomID string)
}
func (c Caches) GetRoomServerRoomID(roomNID types.RoomNID) (string, bool) {
return c.RoomServerRoomIDs.Get(roomNID)
}
func (c Caches) StoreRoomServerRoomID(roomNID types.RoomNID, roomID string) {
c.RoomServerRoomIDs.Set(roomNID, roomID)
}