Documentation ¶ Overview ¶ Package cache provides file-based caching with TTL for statusline data. Index ¶ func Read(path string, ttl time.Duration) ([]byte, bool) func ReadAny(path string) ([]byte, bool) func Write(path string, data []byte) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Read ¶ func Read(path string, ttl time.Duration) ([]byte, bool) Read returns cached content if the file exists and is younger than ttl. func ReadAny ¶ added in v0.2.0 func ReadAny(path string) ([]byte, bool) ReadAny returns cached content regardless of age. func Write ¶ func Write(path string, data []byte) Write stores data to path via temp file + rename for crash safety. Errors are intentionally not returned: cache is best-effort in a statusline tool. A failed write means slightly stale data on the next read, which is acceptable. Types ¶ This section is empty. Source Files ¶ View all Source files cache.go Click to show internal directories. Click to hide internal directories.