Documentation
¶
Overview ¶
Package cache manages CLI cache files in the XDG cache directory.
The cache stores metadata about the registry index (version and fetch timestamp) so that commands can reuse a known-good canonical version without a network call. The actual index data is cached by CUE's module cache; this package only tracks which version was last fetched and when.
Index ¶
Constants ¶
const ( // DefaultMaxAge is the default staleness threshold for the index cache. DefaultMaxAge = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func WriteIndex ¶
WriteIndex writes the index version and current timestamp to the cache file. Creates the cache directory if needed. Errors are returned but callers should treat them as non-fatal (best-effort).
Types ¶
type IndexCache ¶
IndexCache holds the cached registry index metadata.
func ReadIndex ¶
func ReadIndex() (IndexCache, error)
ReadIndex reads the index cache from disk. Returns an error if the file is missing or malformed.