Documentation
¶
Overview ¶
Package cache stores scan results keyed by content hash so unchanged targets are not re-scanned. Keys come from plugin.ComputeCacheKey (a hex SHA, safe as a filename).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Get returns the cached report for key, or ok=false on miss/expiry.
Get(key string) (sarif.Report, bool)
// Put stores report under key.
Put(key string, report sarif.Report) error
}
Cache stores and retrieves scan reports by key.
func ReadOnly ¶ added in v0.61.0
ReadOnly returns a view of c that serves entries and stores none.
For a run whose results should not be trusted by the next one — a pull request from a fork being the case that matters, where the code deciding what the scan sees is not the code the cache is meant to describe. Reading stays useful: the entries already there were written by runs that were trusted.
A wrapper rather than a flag on Local so the guarantee is structural. A boolean checked inside Put is a boolean somebody can forget to check.
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local is a filesystem-backed cache with optional TTL expiry. Safe for concurrent use.