Documentation
¶
Overview ¶
Package aggregate holds cross-target rollup helpers for Phase 4 (ADR-0304). KollectClusterInventory uses MergeRows and ExportCoalesce on the export path; namespaced KollectInventory still marshals per-namespace snapshots directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentHash ¶
ContentHash returns a SHA-256 hex digest of an export payload.
Types ¶
type DedupeMode ¶
type DedupeMode int
DedupeMode selects how MergeRows collapses overlapping target rows.
const ( // DedupeKeepAll retains one row per (target, uid) — current inventory behavior. DedupeKeepAll DedupeMode = iota // DedupeByResourceUID keeps the last row per (namespace, uid) across targets. DedupeByResourceUID )
func DedupeModeFromSpec ¶
func DedupeModeFromSpec(spec *kollectdevv1alpha1.KollectClusterInventorySpec) DedupeMode
DedupeModeFromSpec maps KollectClusterInventory.spec.dedupe to MergeRows mode (ADR-0305).
type ExportCoalesce ¶
ExportCoalesce tracks the last successful export fingerprint for debouncing.
func (*ExportCoalesce) RecordExport ¶
func (c *ExportCoalesce) RecordExport(now time.Time, generation int64, payload []byte)
RecordExport stores the fingerprint after a successful export.
func (*ExportCoalesce) ShouldSkip ¶
func (c *ExportCoalesce) ShouldSkip( now time.Time, minInterval time.Duration, generation int64, payload []byte, ) bool
ShouldSkip reports whether an export can be coalesced within minInterval. Spec generation bumps and payload checksum changes bypass the interval (same rules as KollectInventory reconciler debounce).
type ResourceUID ¶
ResourceUID is the cross-target collapse key when two targets watch the same object.
func ResourceKeyFromItem ¶
func ResourceKeyFromItem(item collect.Item) ResourceUID
ResourceKeyFromItem returns the resource-level dedupe key (namespace + uid).
type RowIdentity ¶
type RowIdentity struct {
TargetNamespace string
TargetName string
Namespace string
Name string
UID string
}
RowIdentity is the stable key for one collected row across targets.
func IdentityFromItem ¶
func IdentityFromItem(item collect.Item) RowIdentity
IdentityFromItem derives a row identity from a collected item.