aboutsummaryrefslogtreecommitdiff
path: root/internal/caching/immutablecache.go
blob: fea05dd1b1be8e8f4d5b70500680254c9fb546f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)
}