cache

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package cache provides file-based caching with TTL for statusline data.

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL