dendrite/common/caching/immutablecache.go
Neil Alexander 419ff150d4
Implement key caching directly (#1038)
* Use gomatrixserverlib key caching

* Implement key caching wrapper

* Add caching wrapper in BaseComponent

* Review comments
2020-05-15 09:32:40 +01:00

16 lines
553 B
Go

package caching
import "github.com/matrix-org/gomatrixserverlib"
const (
RoomVersionMaxCacheEntries = 128
ServerKeysMaxCacheEntries = 128
)
type ImmutableCache interface {
GetRoomVersion(roomId string) (gomatrixserverlib.RoomVersion, bool)
StoreRoomVersion(roomId string, roomVersion gomatrixserverlib.RoomVersion)
GetServerKey(request gomatrixserverlib.PublicKeyLookupRequest) (gomatrixserverlib.PublicKeyLookupResult, bool)
StoreServerKey(request gomatrixserverlib.PublicKeyLookupRequest, response gomatrixserverlib.PublicKeyLookupResult)
}