{"modulePath":"github.com/sqlatlas/gui","version":"v6.1.6+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package dashdiffs\n\n## Variables\n\n```go\nvar (\n\t// ErrUnsupportedDiffType occurs when an invalid diff type is used.\n\tErrUnsupportedDiffType = errors.New(\"dashdiff: unsupported diff type\")\n\t// ErrNilDiff occurs when two compared interfaces are identical.\n\tErrNilDiff = errors.New(\"dashdiff: diff is nil\")\n)\n```\n\n## Types\n\n```go\ntype AsciiLine struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype BasicBlock struct {\n\tTitle     string\n\tOld       interface{}\n\tNew       interface{}\n\tChange    ChangeType\n\tChanges   []*BasicChange\n\tSummaries []*BasicSummary\n\tLineStart int\n\tLineEnd   int\n}\n```\nA BasicBlock represents a top-level element in a basic diff.\n\n```go\ntype BasicChange struct {\n\tKey       string\n\tOld       interface{}\n\tNew       interface{}\n\tChange    ChangeType\n\tLineStart int\n\tLineEnd   int\n}\n```\nA BasicChange represents the change from an old to new value. There are many BasicChanges in a BasicBlock.\n\n```go\ntype BasicDiff struct {\n\tLastIndent int\n\tBlock      *BasicBlock\n\tChange     *BasicChange\n\tSummary    *BasicSummary\n\t// contains filtered or unexported fields\n}\n```\nA BasicDiff holds the stateful values that are used when generating a basic diff from JSON tokens.\n\n```go\nfunc (b *BasicDiff) Basic(lines []*JSONLine) []*BasicBlock\n```\nBasic transforms a slice of JSONLines into a slice of BasicBlocks.\n\n```go\ntype BasicFormatter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewBasicFormatter(left interface{}) *BasicFormatter\n```\n\n```go\nfunc (b *BasicFormatter) Format(d diff.Diff) ([]byte, error)\n```\nFormat takes the diff of two JSON documents, and returns the difference between them summarized in an HTML document.\n\n```go\ntype BasicSummary struct {\n\tKey       string\n\tChange    ChangeType\n\tCount     int\n\tLineStart int\n\tLineEnd   int\n}\n```\nA BasicSummary represents the changes within a basic block that're too deep or verbose to be represented in the top-level BasicBlock element, or in the BasicChange. Instead of showing the values in this case, we simply print the key and count how many times the given change was applied to that element.\n\n```go\ntype ChangeType int\n```\n\n```go\nconst (\n\tChangeNil ChangeType = iota\n\tChangeAdded\n\tChangeDeleted\n\tChangeOld\n\tChangeNew\n\tChangeUnchanged\n)\n```\n\n```go\ntype DiffTarget struct {\n\tDashboardId      int64\n\tVersion          int\n\tUnsavedDashboard *simplejson.Json\n}\n```\n\n```go\ntype DiffType int\n```\n\n```go\nconst (\n\tDiffJSON DiffType = iota\n\tDiffBasic\n\tDiffDelta\n)\n```\n\n```go\nfunc ParseDiffType(diff string) DiffType\n```\n\n```go\ntype JSONFormatter struct {\n\tLines []*JSONLine\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewJSONFormatter(left interface{}) *JSONFormatter\n```\n\n```go\nfunc (f *JSONFormatter) Format(diff diff.Diff) (result string, err error)\n```\n\n```go\ntype JSONLine struct {\n\tLineNum   int         `json:\"line\"`\n\tLeftLine  int         `json:\"leftLine\"`\n\tRightLine int         `json:\"rightLine\"`\n\tIndent    int         `json:\"indent\"`\n\tText      string      `json:\"text\"`\n\tChange    ChangeType  `json:\"changeType\"`\n\tKey       string      `json:\"key\"`\n\tVal       interface{} `json:\"value\"`\n}\n```\nJSONLine contains the data required to render each line of the JSON diff and contains the data required to produce the tokens output in the basic diff.\n\n```go\ntype Options struct {\n\tOrgId    int64\n\tBase     DiffTarget\n\tNew      DiffTarget\n\tDiffType DiffType\n}\n```\n\n```go\ntype Result struct {\n\tDelta []byte `json:\"delta\"`\n}\n```\n\n```go\nfunc CalculateDiff(options *Options) (*Result, error)\n```\nCompareDashboardVersionsCommand computes the JSON diff of two versions, assigning the delta of the diff to the \\`Delta\\` field.\n\n","path":"github.com/sqlatlas/gui/pkg/components/dashdiffs","name":"dashdiffs","synopsis":"","isRedistributable":true}
