Documentation
¶
Overview ¶
Package localcache pre-fetches whole files from slow/remote mounts (rclone / Google Drive) onto fast local disk so playback is instant, seekable, and immune to the intermittent I/O errors the FUSE mount throws. Unlike rclone's own VFS cache — which only fills as bytes are read, so the FIRST play still pays the cold-start latency — this downloads the ENTIRE file up front when the user marks it, then serves it locally. The cache is size-capped with LRU eviction (like the torrent piece cache), so it never fills the disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores fully-copied files under root, capped at maxBytes (LRU eviction).
func New ¶
New creates (or reopens) a cache rooted at root, capped at maxGB gigabytes (≤0 → 50 GiB default), and starts the copy worker. Existing ready files are reloaded from the on-disk index.
func (*Cache) CachedPath ¶
CachedPath returns the local cached path for (mount, path) when ready, and bumps its LRU recency so an actively-watched file isn't evicted.
func (*Cache) Enqueue ¶
Enqueue marks (mount, path) for caching: copies srcAbs (the resolved on-disk path on the slow mount) to local disk in the background. A no-op if the file is already cached or in flight.