Documentation
¶
Overview ¶
Package filecache provides shared on-disk caching helpers for matcher, analyzer, and detector implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDir ¶ added in v0.17.0
DefaultDir returns the directory a component's cache lives in by default, ~/.bomly/cache/<parts...>, for example DefaultDir("licenses", "depsdev"). It is the one place that location is built, so every component caches under the same root and the access a plugin declares ("home") stays true.
When the user's home directory cannot be determined, DefaultDir returns an error rather than a relative path. A relative fallback lands in whatever directory Bomly happens to run in, which no access declaration describes (bomly-planning#115); a component that gets the error runs without a cache by passing a nil *FileCache. Each element must be a single, non-empty path name.
Types ¶
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
FileCache stores JSON-encoded values on disk with a TTL. A nil *FileCache is a valid cache that stores nothing: Get always misses and Set does nothing, so a component whose cache directory is unavailable runs uncached without guarding every call.