mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 11:41:38 +00:00
22 lines
712 B
Go
22 lines
712 B
Go
|
package caching
|
||
|
|
||
|
import (
|
||
|
"github.com/matrix-org/dendrite/roomserver/types"
|
||
|
"github.com/matrix-org/gomatrixserverlib"
|
||
|
)
|
||
|
|
||
|
// RoomServerEventsCache contains the subset of functions needed for
|
||
|
// a roomserver event cache.
|
||
|
type RoomServerEventsCache interface {
|
||
|
GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool)
|
||
|
StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event)
|
||
|
}
|
||
|
|
||
|
func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) {
|
||
|
return c.RoomServerEvents.Get(int64(eventNID))
|
||
|
}
|
||
|
|
||
|
func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) {
|
||
|
c.RoomServerEvents.Set(int64(eventNID), event)
|
||
|
}
|