Versions in this module Expand all Collapse all v0 v0.3.0 Oct 7, 2026 Changes in this version + const AsBool + const AsNumber + const FnLower + const FnMap type Source + Else json.RawMessage + From string + Values map[string]json.RawMessage v0.2.0 Sep 22, 2026 Changes in this version type Config + MaxPooledInput int v0.1.0 Sep 22, 2026 Changes in this version + const ArraysIndex + const ArraysRaw + const ArraysString + const AsRaw + const AsString + const CollisionError + const CollisionFirst + const CollisionKeep + const FnClockSkew + const MergeArray + const MergeConcat + const MergeFirst + const NormalizeNone + const NormalizeSnake + const OpDefault + const OpDrop + const OpMerge + const OpRename + var ErrCollision = errors.New("jsonflat: key collision") + var ErrExplode = errors.New("jsonflat: input.explode path is not an array") + var ErrInvalidNumber = errors.New("jsonflat: invalid number") + var ErrNoOutput = errors.New("jsonflat: no output matches the record") + var ErrNotSimple = errors.New("jsonflat: the config can produce several rows; use Each") + var ErrRequired = errors.New("jsonflat: required value is empty") + var ErrRootNotContainer = errors.New("jsonflat: record is not an object or an array") + type Alias struct + From []string + To string + When *Cond + type Column struct + As string + From SourceList + Quiet bool + To string + When *Cond + type Cond struct + Equals *string + Exists *bool + In []string + Path SourceList + type Config struct + Columns []Column + Derive map[string]Derive + Expose SourceList + Flatten FlattenConfig + Input InputConfig + Keys KeysConfig + Newline bool + Outputs []Output + Rules []Rule + Sections []Section + type Derive struct + DigitPrefix string + From SourceList + Normalize string + Required bool + Reserved []string + ReservedPrefix string + When *Cond + type FlattenConfig struct + Arrays string + DropEmptyObjects bool + DropNulls bool + MaxDepth int + Separator string + type InputConfig struct + Explode string + Inherit []string + type KeysConfig struct + Aliases []Alias + DigitPrefix string + Drop []string + Keep []string + Normalize string + OnCollision string + Rest string + SegmentAliases map[string]string + type Options struct + Now time.Time + Vars map[string]string + type Output struct + Name string + Sections []string + When *Cond + type Record struct + Dropped int + Err error + Fields [][]byte + Index int + JSON []byte + Name []byte + type Rule struct + From StringList + KeepSources bool + Mode string + Op string + Path string + Sep string + To string + Value json.RawMessage + type Section struct + From string + ID string + Prefix string + Quiet bool + When *Cond + type Source struct + Fn string + Original string + Path string + Sent string + func (s *Source) UnmarshalJSON(b []byte) error + func (s Source) MarshalJSON() ([]byte, error) + type SourceList []Source + func (l *SourceList) UnmarshalJSON(b []byte) error + type StringList []string + func (l *StringList) UnmarshalJSON(b []byte) error + type Transformer struct + func Compile(config []byte) (*Transformer, error) + func MustCompile(config []byte) *Transformer + func New(cfg Config) (*Transformer, error) + func (t *Transformer) Append(dst, src []byte) ([]byte, error) + func (t *Transformer) Each(src []byte, opt Options, fn func(*Record) error) error + func (t *Transformer) Transform(src []byte) ([]byte, error)