Documentation
¶
Overview ¶
Package contentdirs keeps content-addressed directories under a shared config root: one directory per build of an embedded bundle, named <base>-<hash>. PiG builds that share a config root (two installed versions, or stock PiG beside a Piglet Binary) each read and write only their own directory, so no build rewrites another's files or strands its extension builds.
A directory records its last use in its modification time. Eviction keeps the most recently used directories and never removes the caller's own, so a build that is still in use keeps its files.
Index ¶
Constants ¶
const ( // Keep is how many directories of one base survive eviction, the caller's own included. It covers a stock install, a Piglet Binary and an // upgrade in progress sharing one config root; each directory holds a few MiB. Keep = 4 )
Variables ¶
This section is empty.
Functions ¶
func Dirs ¶
Dirs returns the paths of the directories in parent named <base>-<16 hex digits>, most recently used first.
func Evict ¶
Evict removes base's directories in parent beyond the Keep most recently used, never own, and returns the removed paths. The caller holds whatever lock excludes readers of those directories.
Types ¶
This section is empty.