diff

package
v0.0.0-...-229b4da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareJsonHelper

func CompareJsonHelper(a interface{}, b interface{}, pathContext []string, diffs *JsonDiff)

Types

type JsonDiff

type JsonDiff struct {
	Changes []*Node
}

func CompareJson

func CompareJson(a interface{}, b interface{}) *JsonDiff

func (*JsonDiff) Add

func (d *JsonDiff) Add(e *Node)

type Kind

type Kind string
const (
	KindAdd    Kind = "KindAdd"
	KindRemove Kind = "KindRemove"
	KindChange Kind = "KindChange"
	KindSame   Kind = "KindSame"
)

func (Kind) Short

func (d Kind) Short() string

type MapDiff

type MapDiff struct {
	Added   []string
	Removed []string
	Same    []string
}

func SliceDiff

func SliceDiff(as []string, bs []string) *MapDiff

func (*MapDiff) Sort

func (m *MapDiff) Sort()

type Node

type Node struct {
	Kind Kind
	Path []string
	Old  interface{}
	New  interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL