Documentation
¶
Overview ¶
Package store defines the content-hash-keyed persistent cache used by the indexer to skip re-parsing unchanged files. NewMem gives a process-local cache; Open backs the same interface with a single-file SQLite database (modernc.org/sqlite, cgo-free) so the cache survives across runs. The graph itself is always fully loaded to memory, so no relational queries are needed here — store stays a dumb KV blob cache; gob-encoding index.ParseResult is the caller's job (see internal/index.parseCached).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Path string
Hash [32]byte // sha256 of file contents
Blob []byte // gob-encoded index.ParseResult
}
Entry caches the parse result of one file, keyed by its content hash.
type Store ¶
type Store interface {
Get(path string, hash [32]byte) (Entry, bool)
Put(e Entry) error
Flush() error
Close() error
}
Store is a minimal KV cache. Get returns ok=false on miss or hash mismatch. Put may buffer writes; Flush makes any buffered writes durable. Callers that need every prior Put visible to a fresh Store handle (e.g. after process restart) must Flush (or Close, which flushes) first.