Documentation
¶
Overview ¶
Package regexcache provides a process-wide, size-bounded cache of compiled regular expressions.
Regex patterns in AltMount frequently originate from user configuration or API request payloads (scoring rules, exclude keywords, custom formats). Caching them unboundedly lets unique per-request patterns accumulate forever and grow heap usage indefinitely, so the cache resets once it exceeds a cap; hot patterns are rebuilt lazily on the next miss.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the compiled pattern, compiling and caching it on first use. Patterns without an explicit case directive are compiled case-insensitive, mirroring the historical behavior at each former call site. It returns (nil, err) when the pattern does not compile; failed patterns are never cached so transient inputs cannot poison the cache.
Types ¶
This section is empty.