Documentation
¶
Overview ¶
Package diffprep owns canonical diff preparation independently of output formats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareSnapshots ¶
func PrepareSnapshots(orig, current Snapshot, opts *Options) (Prepared, []Suppression)
PrepareSnapshots pairs the documents Suppress retains under each side's comparison identities.
Types ¶
type Doc ¶
Doc borrows an immutable document and its producer attribution.
func Documents ¶
func Documents(manifests []manifest.DocumentBatch) []Doc
Documents projects selected batches without copying their immutable manifests.
type Options ¶
type Options struct {
Subjects [2]map[manifest.NamedResource]manifest.DiagnosticIdentity
StripAttrs []string
StripFields []string
Normalize func(map[string]any)
// contains filtered or unexported fields
}
Options controls normalization before canonical pairing.
type Pair ¶
type Pair struct {
Parent Parent
Resource manifest.NamedResource
APIVersion string
OldPos, NewPos int
Old, New map[string]any
OldChart, NewChart string
}
Pair retains normalized sides and authored attribution for a canonical resource pair.
type Parent ¶
type Parent struct {
manifest.NamedResource
Path string
}
Parent identifies a producer and its display path.
type Prepared ¶
type Prepared struct {
Subjects [2]map[manifest.NamedResource]manifest.DiagnosticIdentity
Pairs []Pair
Warnings []manifest.Warning
// contains filtered or unexported fields
}
Prepared retains unchanged pairs for native document-count and ordering semantics.
type Snapshot ¶
type Snapshot struct {
Subjects map[manifest.NamedResource]manifest.DiagnosticIdentity
Manifests []manifest.DocumentBatch
// ProducerKeys maps actual producers to their paired comparison identities.
ProducerKeys map[manifest.NamedResource]manifest.NamedResource
}
Snapshot contains immutable selected batches and producer availability.
type Suppression ¶
type Suppression struct {
Parent Parent
Subject manifest.DiagnosticIdentity
Side Side
Count int
Reason string
}
Suppression discloses withheld producer output.
func (Suppression) String ¶
func (s Suppression) String() string
String renders the suppression as a human-readable sentence.
type SuppressionResult ¶
type SuppressionResult struct {
Orig, Current []manifest.DocumentBatch
Suppressed []Suppression
}
SuppressionResult keeps both retained sides with their shared withholding reasons.
func Suppress ¶
func Suppress(orig, current Snapshot) SuppressionResult
Suppress withholds unavailable producer batches on both comparison sides. Producer identity excludes paths; counts measure withheld document entries.