MCPcopy
hub / github.com/perkeep/perkeep / KvHaveCache

Struct KvHaveCache

cmd/pk-put/kvcache.go:51–54  ·  view source on GitHub ↗

KvHaveCache is a HaveCache on top of a single mutable database file on disk using github.com/syndtr/goleveldb. It stores the blobref in binary as the key, and the blobsize in binary as the value. Access to the cache is restricted to one process at a time with a lock file. Close should be called to r

Source from the content-addressed store, hash-verified

49// at a time with a lock file. Close should be called
50// to remove the lock.
51type KvHaveCache struct {
52 filename string
53 db *leveldb.DB
54}
55
56func NewKvHaveCache(gen string) *KvHaveCache {
57 cleanCacheDir()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected