2022-03-01 16:32:48 +00:00
|
|
|
package caching
|
|
|
|
|
2023-04-06 08:55:01 +00:00
|
|
|
import "github.com/matrix-org/gomatrixserverlib/fclient"
|
2022-03-01 16:32:48 +00:00
|
|
|
|
2023-07-20 14:06:05 +00:00
|
|
|
// RoomHierarchy cache caches responses to federated room hierarchy requests (A.K.A. 'space summaries')
|
|
|
|
type RoomHierarchyCache interface {
|
|
|
|
GetRoomHierarchy(roomID string) (r fclient.RoomHierarchyResponse, ok bool)
|
|
|
|
StoreRoomHierarchy(roomID string, r fclient.RoomHierarchyResponse)
|
2022-03-01 16:32:48 +00:00
|
|
|
}
|
|
|
|
|
2023-07-20 14:06:05 +00:00
|
|
|
func (c Caches) GetRoomHierarchy(roomID string) (r fclient.RoomHierarchyResponse, ok bool) {
|
|
|
|
return c.RoomHierarchies.Get(roomID)
|
2022-03-01 16:32:48 +00:00
|
|
|
}
|
|
|
|
|
2023-07-20 14:06:05 +00:00
|
|
|
func (c Caches) StoreRoomHierarchy(roomID string, r fclient.RoomHierarchyResponse) {
|
|
|
|
c.RoomHierarchies.Set(roomID, r)
|
2022-03-01 16:32:48 +00:00
|
|
|
}
|