aboutsummaryrefslogtreecommitdiff
path: root/serverkeyapi/inthttp/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'serverkeyapi/inthttp/client.go')
-rw-r--r--serverkeyapi/inthttp/client.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/serverkeyapi/inthttp/client.go b/serverkeyapi/inthttp/client.go
index f986634b..f22b0e31 100644
--- a/serverkeyapi/inthttp/client.go
+++ b/serverkeyapi/inthttp/client.go
@@ -24,7 +24,7 @@ const (
func NewServerKeyClient(
serverKeyAPIURL string,
httpClient *http.Client,
- immutableCache caching.ImmutableCache,
+ cache caching.ServerKeyCache,
) (api.ServerKeyInternalAPI, error) {
if httpClient == nil {
return nil, errors.New("NewRoomserverInternalAPIHTTP: httpClient is <nil>")
@@ -32,14 +32,14 @@ func NewServerKeyClient(
return &httpServerKeyInternalAPI{
serverKeyAPIURL: serverKeyAPIURL,
httpClient: httpClient,
- immutableCache: immutableCache,
+ cache: cache,
}, nil
}
type httpServerKeyInternalAPI struct {
serverKeyAPIURL string
httpClient *http.Client
- immutableCache caching.ImmutableCache
+ cache caching.ServerKeyCache
}
func (s *httpServerKeyInternalAPI) KeyRing() *gomatrixserverlib.KeyRing {
@@ -71,7 +71,7 @@ func (s *httpServerKeyInternalAPI) StoreKeys(
response := api.InputPublicKeysResponse{}
for req, res := range results {
request.Keys[req] = res
- s.immutableCache.StoreServerKey(req, res)
+ s.cache.StoreServerKey(req, res)
}
return s.InputPublicKeys(ctx, &request, &response)
}
@@ -92,7 +92,7 @@ func (s *httpServerKeyInternalAPI) FetchKeys(
}
now := gomatrixserverlib.AsTimestamp(time.Now())
for req, ts := range requests {
- if res, ok := s.immutableCache.GetServerKey(req); ok {
+ if res, ok := s.cache.GetServerKey(req); ok {
if now > res.ValidUntilTS && res.ExpiredTS == gomatrixserverlib.PublicKeyNotExpired {
continue
}
@@ -107,7 +107,7 @@ func (s *httpServerKeyInternalAPI) FetchKeys(
}
for req, res := range response.Results {
result[req] = res
- s.immutableCache.StoreServerKey(req, res)
+ s.cache.StoreServerKey(req, res)
}
return result, nil
}