Documentation
¶
Overview ¶
Package bytesize parses free-space/capacity thresholds shared by internal/config (validating [disk] and cache-volume budget settings) and internal/diskguard (comparing them against live statfs results). It is a leaf package — it imports nothing internal — specifically so both of those packages can import it without an import cycle: internal/diskguard transitively imports internal/config (diskguard -> cachestore -> provider -> config), so internal/config cannot import internal/diskguard itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Threshold ¶
Threshold is a free-space floor, expressed as either a percentage of the filesystem's total capacity or an absolute byte count. ParseThreshold only ever sets one of the two fields — BytesOf relies on that to decide which one applies.
func ParseThreshold ¶
ParseThreshold parses a free-space threshold: a percentage of total capacity like "10%" (0-100 inclusive), or an absolute size like "20GB" or "512MB" (binary units, case-insensitive: B/KB/MB/GB/TB).