mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
federation/cache: expose noop cache as variable instead of type
This commit is contained in:
parent
dec68fb4d7
commit
0a33bde865
1 changed files with 11 additions and 9 deletions
|
|
@ -136,16 +136,18 @@ func (c *InMemoryCache) ShouldReQuery(serverName string) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
type NoopCache struct{}
|
||||
type noopCache struct{}
|
||||
|
||||
func (*NoopCache) StoreKeys(_ *ServerKeyResponse) {}
|
||||
func (*NoopCache) LoadKeys(_ string) (*ServerKeyResponse, error) { return nil, nil }
|
||||
func (*NoopCache) StoreFetchError(_ string, _ error) {}
|
||||
func (*NoopCache) ShouldReQuery(_ string) bool { return true }
|
||||
func (*NoopCache) StoreResolution(_ *ResolvedServerName) {}
|
||||
func (*NoopCache) LoadResolution(_ string) (*ResolvedServerName, error) { return nil, nil }
|
||||
func (*noopCache) StoreKeys(_ *ServerKeyResponse) {}
|
||||
func (*noopCache) LoadKeys(_ string) (*ServerKeyResponse, error) { return nil, nil }
|
||||
func (*noopCache) StoreFetchError(_ string, _ error) {}
|
||||
func (*noopCache) ShouldReQuery(_ string) bool { return true }
|
||||
func (*noopCache) StoreResolution(_ *ResolvedServerName) {}
|
||||
func (*noopCache) LoadResolution(_ string) (*ResolvedServerName, error) { return nil, nil }
|
||||
|
||||
var (
|
||||
_ ResolutionCache = (*NoopCache)(nil)
|
||||
_ KeyCache = (*NoopCache)(nil)
|
||||
_ ResolutionCache = (*noopCache)(nil)
|
||||
_ KeyCache = (*noopCache)(nil)
|
||||
)
|
||||
|
||||
var NoopCache *noopCache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue