lib

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Unknown   DiffType = "unknown"
	Added              = "added"
	Removed            = "removed"
	Changed            = "changed"
	Unchanged          = "unchanged"
)

Variables

This section is empty.

Functions

func EnsureStringMap added in v1.1.0

func EnsureStringMap(value any) map[string]interface{}

Types

type DiffType

type DiffType string

type YamlDiffEntry

type YamlDiffEntry struct {
	Path     []string
	ValueOld interface{}
	ValueNew interface{}
}

func (YamlDiffEntry) GetType

func (e YamlDiffEntry) GetType() DiffType

type YamlDiffResult

type YamlDiffResult struct {
	Diffs     []YamlDiffEntry
	Structure map[string]*YamlDiffStructure
}

func DiffYaml

func DiffYaml(oldYaml map[string]interface{}, newYaml map[string]interface{}) YamlDiffResult

DiffYaml compares two map[string]interface{} objects (e.g. read via YAML parser).

func (YamlDiffResult) Get

func (r YamlDiffResult) Get(path []string) []YamlDiffEntry

Get is deprecated. Use GetAll instead. @deprecated

func (YamlDiffResult) GetAll added in v1.1.0

func (r YamlDiffResult) GetAll(path []string) []YamlDiffEntry

Get returns the differences for the node identified by the path

func (YamlDiffResult) GetStructure added in v1.1.0

func (r YamlDiffResult) GetStructure(path []string) *YamlDiffStructure

GetStructure returns the structure for the node identified by the path Access the diff for that node or its children for diff information.

func (YamlDiffResult) HasChanged

func (r YamlDiffResult) HasChanged(path []string) bool

HasChanged returns true when there differences for the node

type YamlDiffStructure added in v1.1.0

type YamlDiffStructure struct {
	// contains filtered or unexported fields
}

func (YamlDiffStructure) GetChildren added in v1.1.0

func (y YamlDiffStructure) GetChildren() map[string]*YamlDiffStructure

func (YamlDiffStructure) GetDiff added in v1.1.0

func (y YamlDiffStructure) GetDiff() YamlDiffEntry

func (YamlDiffStructure) GetFullPath added in v1.1.0

func (y YamlDiffStructure) GetFullPath() []string

func (YamlDiffStructure) GetName added in v1.1.0

func (y YamlDiffStructure) GetName() string

Jump to

Keyboard shortcuts

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