Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DocumentToUntyped ¶ added in v1.12.0
func DocumentToUntyped(doc interface{}) (interface{}, error)
DocumentToUntyped converts a typed object to JSON data i.e. string, []interface{}, map[string]interface{}
Types ¶
type Action ¶
type Action func(data *ActionData) (interface{}, error)
Action encapsulates the logic that must be performed for each JSON element
func OnlyForLeafsAndKeys ¶
OnlyForLeafsAndKeys is an action modifier - apply action only for leafs and map keys
type ActionData ¶
type ActionData struct { Document interface{} Element interface{} Path string }
ActionData represents data available for action on current element
type Traversal ¶
type Traversal struct {
// contains filtered or unexported fields
}
Traversal is a type that encapsulates JSON traversal algorithm It traverses entire JSON structure applying some logic to its elements
func NewTraversal ¶
NewTraversal creates JSON Traversal object
func (*Traversal) TraverseJSON ¶
TraverseJSON performs a traverse of JSON document and applying action for each JSON element
Click to show internal directories.
Click to hide internal directories.