MCPcopy Create free account
hub / github.com/PostHog/duckgres / Get

Method Get

cmd/cache-proxy/cache.go:174–190  ·  view source on GitHub ↗

Get returns the cached data for the given key, or nil if not found.

(key string)

Source from the content-addressed store, hash-verified

172 // at the back. index maps a key to its element for O(1) touch/drop.
173 order *list.List
174 index map[string]*list.Element
175 // summary is enabled only in summary lookup mode. It mirrors index
176 // mutations incrementally, so snapshot serving never scans the cache index.
177 summary *summaryIndex
178 // renameFile is os.Rename in production and a per-cache failure seam in tests.
179 renameFile func(string, string) error
180 // removeFile is os.Remove in production and a per-cache failure seam in tests.
181 removeFile func(string) error
182 // openScanDirectory is os.Open in production and lets constructor tests
183 // inject directory-open and mid-scan failures deterministically.
184 openScanDirectory openCacheDirectory
185
186 // Durable recency is optional for tests and always enabled by main. Exact
187 // LRU updates remain synchronous; only coarse mtime persistence is queued.
188 recency *recencyWriter
189 recencyNow func() time.Time
190 recencyInterval time.Duration
191 // commitMu linearizes the short final rename/accounting/recency commit with
192 // shutdown without coupling lifecycle progress to a potentially blocking
193 // pressure-driven unlink under mu.

Callers 15

requestSpanAttrsFunction · 0.45
HandleProxyMethod · 0.45
fetchOriginMethod · 0.45
fetchOriginOnceMethod · 0.45
HandlePeerHasMethod · 0.45
HandlePeerGetMethod · 0.45
newPeerServerFunction · 0.45

Calls 2

touchLockedMethod · 0.95
IsValidCacheKeyFunction · 0.85