Documentation
¶
Overview ¶
Package qparam normalizes URL query-parameter values before they hit the wire.
Currently it covers date parameters: the public API accepts millisecond-epoch integers, but humans prefer to type ISO-8601 ("2026-04-01T00:00:00Z" or "2026-04-01"). MaybeDate detects parameters whose names imply a timestamp (suffixes "AtFrom", "AtTo", "Since", "Before", "After") and converts ISO-8601 inputs to millisecond strings; numeric inputs pass through unchanged.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaybeDate ¶
MaybeDate coerces a value if the param name implies a timestamp.
- All-digit input is treated as already-epoch-millis and passed through.
- ISO-8601 ("2026-04-01T00:00:00Z", "2026-04-01T00:00:00.123Z", "2026-04-01") is parsed and converted to millis.
- Anything else returns a wrapped error naming the offending param.
Non-date params return the input unchanged.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.