differ

package
v0.0.0-...-4d3262c Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffResult

type DiffResult struct {
	ConfigMapName string
	FileDiffs     []FileDiff
}

DiffResult contains all file diffs for a ConfigMap

func (*DiffResult) HasDifferences

func (r *DiffResult) HasDifferences() bool

HasDifferences returns true if there are any differences

type DiffStatus

type DiffStatus int

DiffStatus represents the status of a file comparison

const (
	// Identical means files are the same
	Identical DiffStatus = iota
	// Modified means file exists in both but content differs
	Modified
	// OnlyLocal means file only exists locally
	OnlyLocal
	// OnlyK8s means file only exists in K8s ConfigMap
	OnlyK8s
)

func (DiffStatus) String

func (s DiffStatus) String() string

type Differ

type Differ struct{}

Differ compares local files with ConfigMap data

func NewDiffer

func NewDiffer() *Differ

NewDiffer creates a new Differ

func (*Differ) Compare

func (d *Differ) Compare(localFiles, k8sFiles map[string]string) (*DiffResult, error)

Compare compares local files with K8s ConfigMap data

type FileDiff

type FileDiff struct {
	FileName     string
	Status       DiffStatus
	LocalContent string
	K8sContent   string
	UnifiedDiff  string
}

FileDiff represents the diff result for a single file

Jump to

Keyboard shortcuts

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