Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Modifiers = map[string]ModifierFactoryFunc{}
Functions ¶
func Pick ¶
Pick converts data into a []any, map[string]any, etc. (using json marshal->unmarshal) containing only the fields from the parsed rawFields expression.
rawFields is a comma separated string of the fields to include. Nested fields should be listed with dot-notation. Fields value modifiers are also supported using the `:modifier(args)` format (see Modifiers).
Example:
data := map[string]any{"a": 1, "b": 2, "c": map[string]any{"c1": 11, "c2": 22}} Pick(data, "a,c.c1") // map[string]any{"a": 1, "c": map[string]any{"c1": 11}}
Types ¶
type ModifierFactoryFunc ¶
Click to show internal directories.
Click to hide internal directories.