MCPcopy Index your code
hub / github.com/VKCOM/nocc / SrcFileCache

Struct SrcFileCache

internal/server/src-cache.go:13–15  ·  view source on GitHub ↗

SrcFileCache is a /tmp/nocc/cpp/src-cache directory, where uploaded .cpp/.h/etc. files are saved. It's supposed that sha256 uniquely identifies the file, that's why a map key doesn't contain size/mtime. It's useful to share files across clients (if one client has uploaded a file, the second takes it

Source from the content-addressed store, hash-verified

11// It's useful to share files across clients (if one client has uploaded a file, the second takes it from cache).
12// Also, it helps reuse files across the same client after it was considered inactive and deleted, but launched again.
13type SrcFileCache struct {
14 *FileCache
15}
16
17func MakeSrcFileCache(cacheDir string, limitBytes int64) (*SrcFileCache, error) {
18 cache, err := MakeFileCache(cacheDir, limitBytes)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected