Documentation
¶
Overview ¶
Package tony provides support and tooling for the Tony format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
Diff produces a succint comparison of from and to. If there are no differences, Diff returns nil.
A resulting diff may be reversed using libdiff.Reverse.
A resulting diff may be used as a patch in Patch.
The structure returned by Diff contains a minimal set of changes indicated by yaml tags which double as patch operations.
if the types of from and to differ then the result is a node !replace from: from to: to
for ObjectType any field f in to but not in from has a field `f: !delete[(<orig-tag>)] ...`
for ObjectType any field f in from but not in to has a field `f: !insert[(<orig-tag>)] ...`
for any field f shared by from and to which is equal, it is absent in the result.
for any field f with a difference, it contains a diff of the value of f in from and respectively to.
For ArrayType nodes which differ, if both nodes are tagged by the same key with !key(<key>), they are treated as objects but presented as an array with tag !key(<key>).
For StringTypes, a string diff may computed and if the size of the string diff is less than half the size of the the smallest string
If only the tags differ, the tags !addtag(<tag>) !rmtag(<tag>) and !retag(<from>,<to>) will be present decorating a null.
Types ¶
type DiffConfig ¶
type DiffConfig struct {
Comments bool
}
type MatchConfig ¶
type PatchConfig ¶
type PatchConfig struct {
Comments bool
}
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
o
command
|
|
|
tony-codegen
command
|
|
|
tony-lsp
command
|
|
|
Package dirbuild interprets a tony build directory
|
Package dirbuild interprets a tony build directory |
|
Package ir provides the intermediate representation (IR) for Tony format documents.
|
Package ir provides the intermediate representation (IR) for Tony format documents. |
|
Package mergeop provides operations for matching and patching Tony format documents.
|
Package mergeop provides operations for matching and patching Tony format documents. |
|
Package schema provides support for Tony Schema, a schema system for describing and validating Tony format documents.
|
Package schema provides support for Tony Schema, a schema system for describing and validating Tony format documents. |
|
Package stream provides streaming encode/decode for Tony documents.
|
Package stream provides streaming encode/decode for Tony documents. |
|
system
|
|
|
logd
Package logd provides the backend storage for the tony system api.
|
Package logd provides the backend storage for the tony system api. |
|
logd/storage
Package storage provides a filesystem based storage layer for tony system api.
|
Package storage provides a filesystem based storage layer for tony system api. |
|
Package token provides tokenization support for Tony and related formats.
|
Package token provides tokenization support for Tony and related formats. |