Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheEntry ¶
type CacheEntry struct {
Version string `json:"version"`
Data json.RawMessage `json:"data"`
}
CacheEntry wraps a cached value with a version key for invalidation.
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
FileCache provides a file-based cache using os.UserCacheDir for OS-agnostic storage. Each entry is a JSON file keyed by a hash of the cache key.
func NewFileCache ¶
NewFileCache creates a new file cache in the given subdirectory under os.UserCacheDir. For example, NewFileCache("allbctl", "languages") uses ~/.cache/allbctl/languages/ on Linux.
func NewFileCacheInDir ¶
NewFileCacheInDir creates a file cache in an explicit directory. Useful for testing.
Click to show internal directories.
Click to hide internal directories.