Discover Packages
github.com/idelchi/aura
pkg
cache
package
Version:
v0.0.1-beta
Opens a new window with list of versions in this module.
Published: Apr 14, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package cache provides domain-scoped file caching under a shared cache directory.
Each domain maps to a subdirectory (e.g., "catwalk" → cache/catwalk/).
No TTL — cached data is always valid until manually cleared via Clear()
or bypassed with the NoCache option.
Cache is the top-level cache manager rooted at a directory.
New creates a cache rooted at writeHome/cache.
If noCache is true, Read always returns a miss but Write still persists data.
Clean removes the entire cache directory.
Dir returns the root cache directory path.
func (*Cache) Domain ¶
Domain returns a sub-cache for a specific purpose (e.g., "catwalk", "models").
Domain is a scoped sub-cache within a named subdirectory.
func (*Domain) Clear ¶
Clear removes all entries in this domain.
func (*Domain) Read ¶
Read returns cached data for the given key.
Returns nil and false on cache miss, read error, or when noCache is set.
func (*Domain) Write ¶
Write persists data under the given key.
Creates the domain directory if it doesn't exist.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.