MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / Cache

Interface Cache

cache/cache.go:10–17  ·  view source on GitHub ↗

Cache stores results of executed queries identified by Key

Source from the content-addressed store, hash-verified

8
9// Cache stores results of executed queries identified by Key
10type Cache interface {
11 io.Closer
12 // TODO consider the value of Stats in future iterations. Maybe it is not needed?
13 Stats() Stats
14 Get(key *Key) (*CachedData, error)
15 Put(r io.Reader, ctMetadata ContentMetadata, key *Key) (time.Duration, error)
16 Name() string
17}
18
19type ContentMetadata struct {
20 Length int64

Callers 28

refreshCacheMetricsMethod · 0.65
TestCacheSizeFunction · 0.65
TestCacheCleanFunction · 0.65
ServeHTTPMethod · 0.65
shouldRespondFromCacheFunction · 0.65
serveFromCacheMethod · 0.65
newCacheKeyFunction · 0.65
calcQueryParamsHashFunction · 0.65
getAuthFunction · 0.65
getSessionIdFunction · 0.65
getSessionTimeoutFunction · 0.65
serveFromCacheMethod · 0.65

Implementers 2

fileSystemCachecache/filesystem_cache.go
redisCachecache/redis_cache.go

Calls

no outgoing calls

Tested by

no test coverage detected