Documentation ¶
Index ¶
- func DiffDatasets(a, b *dataset.Dataset, deRefData *StructuredDataTuple) (map[string]*SubDiff, error)
- func MapDiffsToString(m map[string]*SubDiff, how string) (string, error)
- type StructuredDataTuple
- type SubDiff
- func DiffData(a, b *dataset.Dataset) (*SubDiff, error)
- func DiffJSON(a, b []byte, kind string) (*SubDiff, error)
- func DiffMeta(a, b *dataset.Meta) (*SubDiff, error)
- func DiffStructure(a, b *dataset.Structure) (*SubDiff, error)
- func DiffTransform(a, b *dataset.Transform) (*SubDiff, error)
- func DiffViz(a, b *dataset.Viz) (*SubDiff, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffDatasets ¶
func DiffDatasets(a, b *dataset.Dataset, deRefData *StructuredDataTuple) (map[string]*SubDiff, error)
DiffDatasets returns a map of pointers to diffs of the components of a dataset. It calls each of the Diff{Component} functions and adds the option for including de-referenced dataset.Data via the StructuredDataTuple TODO (kasey): This function only diffs: Structure, Meta, Transform, Viz, and Data (in JSON or as a Dataset)
func MapDiffsToString ¶
MapDiffsToString generates a string description from a map of diffs Currently the String generated reflects the first/highest priority change made. The priority of changes currently are
- dataset.Structure
- dataset.{Data}
- dataset.Transform
- dataset.Meta
- Dataset.Viz
Types ¶
type StructuredDataTuple ¶
type StructuredDataTuple struct {
// contains filtered or unexported fields
}
StructuredDataTuple provides an additional input for DiffDatasets to use fully de-referenced dataset.data so that we can consider changes in dataset.Data beyond the hash/path being similar or different
type SubDiff ¶
SubDiff holds the diffs of a Dataset Subcomponent diff
func DiffStructure ¶
DiffStructure diffs the structure of two datasets
func DiffTransform ¶
DiffTransform diffs the transform struct of two datasets
func (*SubDiff) MarshalJSON ¶
MarshalJSON marshals the slice of diffs from the SubDiff
func (*SubDiff) SummarizeToString ¶
SummarizeToString outputs a substring in a one of a few formats
- simple (single line describing which component and how many changes)
- listKeys (lists the keys of what changed)
- plusMinusColor (git-style plus/minus printout)
- plusMinus (same as plusMinusColor without color)