From e7b19d2c70be49f3c995a9bfd9dd93ce767d960f Mon Sep 17 00:00:00 2001
From: Neil Alexander <neilalexander@users.noreply.github.com>
Date: Fri, 5 Jun 2020 16:42:01 +0100
Subject: More flexible caching (#1101)

---
 internal/caching/caches.go | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 internal/caching/caches.go

(limited to 'internal/caching/caches.go')

diff --git a/internal/caching/caches.go b/internal/caching/caches.go
new file mode 100644
index 00000000..70f380ba
--- /dev/null
+++ b/internal/caching/caches.go
@@ -0,0 +1,15 @@
+package caching
+
+// Caches contains a set of references to caches. They may be
+// different implementations as long as they satisfy the Cache
+// interface.
+type Caches struct {
+	RoomVersions Cache // implements RoomVersionCache
+	ServerKeys   Cache // implements ServerKeyCache
+}
+
+// Cache is the interface that an implementation must satisfy.
+type Cache interface {
+	Get(key string) (value interface{}, ok bool)
+	Set(key string, value interface{})
+}
-- 
cgit v1.2.3