Documentation
¶
Index ¶
- Constants
- func DiffArrayByIndex(from, to *ir.Node, df DiffFunc) *ir.Node
- func DiffArrayByKey(from, to *ir.Node, key string, df DiffFunc) (*ir.Node, error)
- func DiffNumber(from *ir.Node, to *ir.Node) *ir.Node
- func DiffObject(from, to *ir.Node, df DiffFunc) *ir.Node
- func DiffString(from, to *ir.Node) *ir.Node
- func MakeDiff(from, to *ir.Node) *ir.Node
- func MakeTagDiff(from, to string) string
- func PatchArrayByIndex(doc, patch *ir.Node, df DiffFunc) (*ir.Node, error)
- func PatchStringMultiLine(doc, patch *ir.Node) (*ir.Node, error)
- func PatchStringRunes(doc, patch *ir.Node) (*ir.Node, error)
- func Reverse(diff *ir.Node) (*ir.Node, error)
- func YKeyOf(y *ir.Node, key string) (string, string, error)
- type DiffFunc
Constants ¶
View Source
const ( DeleteTag = "!delete" InsertTag = "!insert" ReplaceTag = "!replace" TagDeleteTag = "!rmtag" TagInsertTag = "!addtag" TagReplaceTag = "!retag" StringDiffTag = "!strdiff" ArrayDiffTag = "!arraydiff" )
Variables ¶
This section is empty.
Functions ¶
func DiffArrayByIndex ¶
we use int keyed map and
- record the type of each node, for non-string scalar types... we use the summary value <type>-<value> where <value> is the string representation
- diff the sequence of summaries
- For every matching type in the result, if that type is not scalar, we recurse
- For every non-matching type, we add an int-keyed map item with the corresponding diff operation tagged
func DiffArrayByKey ¶
func DiffObject ¶
1 diff field names for every different field name add node for every same field name, recurse on the value
func MakeTagDiff ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.