mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
More flexible caching (#1101)
This commit is contained in:
parent
76ff47c052
commit
e7b19d2c70
16 changed files with 189 additions and 142 deletions
15
internal/caching/caches.go
Normal file
15
internal/caching/caches.go
Normal file
|
@ -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{})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue