Documentation
¶
Overview ¶
Package filecache holds the on-disk caches that let a scan skip work on files whose text has not changed: the SAST result cache and the graph facts cache.
A cache is one JSON document per scanned directory and key, at <dir>/<sha256(root)[:16]>/<key>.json. The key names everything the cached results depend on besides the files themselves (the CLI build, the rules); each entry inside names the file text it was computed from. The caches are a convenience: a document that cannot be read is empty, and one that cannot be written is skipped, never an error.
Index ¶
Constants ¶
const Keep = 8
Keep is how many documents (keys) are kept per scanned directory; older ones are removed when a new one is written. Each rule set is its own key, and scan, sast, secrets, iac and containers each evaluate a different one, so fewer than five meant running them in turn over one tree evicted every cache before it was read again.
Variables ¶
This section is empty.
Functions ¶
func ContentSHA ¶
ContentSHA is the hex SHA-256 of a file's text, the identity an entry is checked against.
Types ¶
This section is empty.