Documentation
¶
Overview ¶
Package parse holds the string-to-value parsers for statute's duration, rate, and byte-size config fields. The functions are pure: they take a string and return a primitive or an error, with no dependency on the surface or resolved config types. Kept in internal/ so they are not part of the public API surface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Duration ¶
Duration accepts every unit Go's time.ParseDuration accepts (ns, us, ms, s, m, h) plus "d" for days (24h) and "w" for weeks (7d). Days and weeks are de-sugared by string-rewriting before falling through to the stdlib parser, so they compose with the other units ("1w2d" works).
func DurationOr ¶
DurationOr parses s, or returns fallback when s is empty.
Types ¶
This section is empty.