qparam

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func MaybeDate(name, value string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL