diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-06-05 16:42:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 16:42:01 +0100 |
commit | e7b19d2c70be49f3c995a9bfd9dd93ce767d960f (patch) | |
tree | 0ff8734c896530843537c4c58421964cf89f020d /internal/caching/caches.go | |
parent | 76ff47c0522e03eabd72140bf62e1d0d1d1029e0 (diff) |
More flexible caching (#1101)
Diffstat (limited to 'internal/caching/caches.go')
-rw-r--r-- | internal/caching/caches.go | 15 |
1 files changed, 15 insertions, 0 deletions
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{}) +} |