diff

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Key  []string `yaml:"key"`
	Kind Kind     `yaml:"kind"`

	// depending on kind
	//  - added: set to the added node of new doc
	// 	- updated: set to node of base doc that changed
	//  - deleted: set to node of base doc that deleted
	DivertAt *Node `yaml:"divert_at"`
}

func Diff

func Diff(base, other *Node) []*Entry

Diff

type Kind

type Kind string
const (
	// missing in base doc
	KindAdded Kind = "added"
	// updated in the new doc
	KindUpdated Kind = "updated"
	// deleted in the new doc
	KindDeleted Kind = "deleted"
)

type Node

type Node struct {
	Renderers []*RendererSpec
	RawNode   *yaml.Node
	// contains filtered or unexported fields
}

func (*Node) Append

func (n *Node) Append(other *Node)

func (*Node) Clone

func (n *Node) Clone() *Node

func (*Node) ElementKey

func (n *Node) ElementKey() string

func (*Node) Get

func (n *Node) Get(key []string) (_ *Node, tailKey []string)

Get a trie node according to the key sequence in order exact is set to true when there key always refer to node's children

func (*Node) Key

func (n *Node) Key() []string

func (*Node) MarshalYAML

func (n *Node) MarshalYAML() (interface{}, error)

func (*Node) UnmarshalYAML

func (n *Node) UnmarshalYAML(yn *yaml.Node) error

type RendererSpec

type RendererSpec struct {
	Name     string
	TypeHint string
	Patch    bool
}

func (*RendererSpec) Clone

func (r *RendererSpec) Clone() *RendererSpec

Jump to

Keyboard shortcuts

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