aboutsummaryrefslogtreecommitdiff
path: root/internal/caching/immutablecache.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/caching/immutablecache.go')
-rw-r--r--internal/caching/immutablecache.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/caching/immutablecache.go b/internal/caching/immutablecache.go
new file mode 100644
index 00000000..fea05dd1
--- /dev/null
+++ b/internal/caching/immutablecache.go
@@ -0,0 +1,17 @@
+package caching
+
+import (
+ "github.com/matrix-org/gomatrixserverlib"
+)
+
+const (
+ RoomVersionMaxCacheEntries = 1024
+ ServerKeysMaxCacheEntries = 1024
+)
+
+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)
+}