Documentation
¶
Overview ¶
Package types provides types used in the renderer in order to facilitate code reuse in test
Index ¶
Constants ¶
View Source
const ( // ColorRed an ANSI "begin red" character. ColorRed = "\x1b[31m" // ColorGreen an ANSI "begin green" character. ColorGreen = "\x1b[32m" // ColorYellow an ANSI "begin yellow" character. ColorYellow = "\x1b[33m" // ColorReset an ANSI "reset color" character. ColorReset = "\x1b[0m" )
Colors for terminal output.
Variables ¶
This section is empty.
Functions ¶
func MakeDiffKey ¶
MakeDiffKey creates a unique key for a resource diff. Format: apiVersion/kind/namespace/name (namespace may be empty for cluster-scoped resources).
func MakeDiffKeyFromResource ¶ added in v0.6.2
func MakeDiffKeyFromResource(res *un.Unstructured) string
MakeDiffKeyFromResource creates a unique key for a resource diff from an Unstructured resource. This is a convenience wrapper around MakeDiffKey that extracts all fields from the resource.
Types ¶
type DiffType ¶
type DiffType string
DiffType represents the type of diff (added, removed, modified).
type ResourceDiff ¶
type ResourceDiff struct {
Gvk schema.GroupVersionKind
Namespace string
ResourceName string
DiffType DiffType
LineDiffs []diffmatchpatch.Diff
Current *un.Unstructured // Optional, for reference
Desired *un.Unstructured // Optional, for reference
}
ResourceDiff represents the diff for a specific resource.
func (*ResourceDiff) GetDiffKey ¶
func (d *ResourceDiff) GetDiffKey() string
GetDiffKey returns a key that can be used to identify this object for use in a map.
Click to show internal directories.
Click to hide internal directories.