mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 07:12:53 +00:00
19 lines
678 B
Go
19 lines
678 B
Go
|
package caching
|
||
|
|
||
|
import "github.com/matrix-org/dendrite/roomserver/types"
|
||
|
|
||
|
// EventStateKeyCache contains the subset of functions needed for
|
||
|
// a room event state key cache.
|
||
|
type EventStateKeyCache interface {
|
||
|
GetEventStateKey(eventStateKeyNID types.EventStateKeyNID) (string, bool)
|
||
|
StoreEventStateKey(eventStateKeyNID types.EventStateKeyNID, eventStateKey string)
|
||
|
}
|
||
|
|
||
|
func (c Caches) GetEventStateKey(eventStateKeyNID types.EventStateKeyNID) (string, bool) {
|
||
|
return c.RoomServerStateKeys.Get(eventStateKeyNID)
|
||
|
}
|
||
|
|
||
|
func (c Caches) StoreEventStateKey(eventStateKeyNID types.EventStateKeyNID, eventStateKey string) {
|
||
|
c.RoomServerStateKeys.Set(eventStateKeyNID, eventStateKey)
|
||
|
}
|