types

package
v0.2.1-0...-4d7afa4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

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"
	// ColorReset an ANSI "reset color" character.
	ColorReset = "\x1b[0m"
)

Colors for terminal output.

Variables

This section is empty.

Functions

func MakeDiffKey

func MakeDiffKey(apiVersion, kind, name string) string

MakeDiffKey creates a unique key for a resource diff.

Types

type DiffType

type DiffType string

DiffType represents the type of diff (added, removed, modified).

const (
	// DiffTypeAdded an added section.
	DiffTypeAdded DiffType = "+"
	// DiffTypeRemoved a removed section.
	DiffTypeRemoved DiffType = "-"
	// DiffTypeModified a modified section.
	DiffTypeModified DiffType = "~"
	// DiffTypeEqual an unchanged section.
	DiffTypeEqual DiffType = "="
)

type ResourceDiff

type ResourceDiff struct {
	Gvk          schema.GroupVersionKind
	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.

Jump to

Keyboard shortcuts

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