Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Normalizer ¶
func NewNormalizer ¶
func NewNormalizer(doc string, rules ...Rule) *Normalizer
func (*Normalizer) AddRule ¶
func (n *Normalizer) AddRule(r Rule) *Normalizer
func (*Normalizer) Apply ¶
func (n *Normalizer) Apply() (string, error)
type TimeRule ¶
type TimeRule struct { JSONPaths []string // If TZ is not nil, then we will normalize JSON timezone to TZ. TZ *time.Location // If JSONPath's specified time is in range from Time - PeriodBefore to // Time + PeriodAfter, then we will replace json value with Time. // If Time is zero, then we will not replace json value. Time time.Time PeriodBefore time.Duration PeriodAfter time.Duration // Time format layout. If not specified, then time.RFC3339 Layout string }
TimeRule specifies how to normalize json document. If we find nodes by jsonpath, we will replace
Click to show internal directories.
Click to hide internal directories.