compare

package
v0.0.0-...-c5463a0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterManifest

func FilterManifest(ms string, selectResources string, ignoreResources string) (string, error)

FilterManifest selects and ignores subset from the manifest string

func IsLeafNode

func IsLeafNode(node any) bool

IsLeafNode reports whether the given node is a leaf, assuming internal nodes can only be maps or slices.

func ManifestDiff

func ManifestDiff(a, b string, verbose bool) (string, error)

func ManifestDiffWithRenameSelectIgnore

func ManifestDiffWithRenameSelectIgnore(a, b, renameResources, selectResources, ignoreResources string, verbose bool) (string, error)

ManifestDiffWithSelect checks the manifest differences with selected and ignored resources. The selected filter will apply before the ignored filter.

func UnmarshalInlineYaml

func UnmarshalInlineYaml(obj map[string]any, targetPath string) (err error)

UnmarshalInlineYaml tries to unmarshal string values in obj into YAML objects at a given targetPath. Side effect: this will mutate obj in place.

func YAMLCmp

func YAMLCmp(a, b string) string

YAMLCmp compares two yaml texts, return a tree based diff text.

func YAMLCmpWithIgnore

func YAMLCmpWithIgnore(a, b string, ignorePaths []string, ignoreYaml string) string

YAMLCmpWithIgnore compares two yaml texts, and ignores paths in ignorePaths.

Types

type YAMLCmpReporter

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

YAMLCmpReporter is a custom reporter to generate tree based diff for YAMLs, used by cmp.Equal().

func (*YAMLCmpReporter) PopStep

func (r *YAMLCmpReporter) PopStep()

PopStep implements interface to keep track of current path by popping a step out. of YAMLCmpReporter.path

func (*YAMLCmpReporter) PushStep

func (r *YAMLCmpReporter) PushStep(ps cmp.PathStep)

PushStep implements interface to keep track of current path by pushing. a step into YAMLCmpReporter.path

func (*YAMLCmpReporter) Report

func (r *YAMLCmpReporter) Report(rs cmp.Result)

Report implements interface to add diff path into YAMLCmpReporter.diffTree.

func (*YAMLCmpReporter) String

func (r *YAMLCmpReporter) String() string

String returns a text representation of diff tree.

Jump to

Keyboard shortcuts

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