Documentation
¶
Overview ¶
Package model holds the shared, budget-agnostic intermediate types that flow through the gather → fit → render pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action is the reduced primary-action bucket for a resource change.
func (Action) Mutates ¶ added in v0.5.1
Mutates reports whether the action changes the real resource (create/update/delete/replace), as opposed to pure state bookkeeping (move/import → noop, and forget) that makes no apply-time provider write and so needs no elevated permission. Classification keys off this: a guard category such as `iam` fires only when the apply actually requires the gated (PAM-granted) write permission, not when a resource is merely moved, imported, or forgotten.
type AttrDiff ¶
type AttrDiff struct {
Name string
Variants []Variant
Selected int // chosen variant index; fit mutates this
}
AttrDiff is one changed attribute with its ordered variants (index 0 = preferred).
type Change ¶
type Change struct {
Address string
Type string
Action Action
Fields []Field // populated for create/delete/update/replace/forget
URL string
// State operations (annotations on top of Action; Action may be ActionNoop
// when the only change is a move or import).
Moved bool
PreviousAddress string // old address when Moved
Imported bool
ImportID string // import id when Imported
}
Change is one resource change within a stack.
type Class ¶
Class is the classification result for a stack. Alias of the canonical domain.Category; Label lives there. (Render reads Name/Icon; Attributes ride along harmlessly.)
type Counts ¶
Counts holds per-stack action tallies. Alias of the canonical domain type (shared with the wire protocol); Total/AnyChange live on domain.Counts.
type Field ¶ added in v0.2.0
type Field struct {
Name string
Kind string // "json"/"yaml" for structured blocks; "" otherwise
Leaves []Leaf // inline rows; empty when this is a block
Variants []Variant // block ladder; empty when this is leaves
Selected int // chosen variant (block only); fit mutates
}
Field is one top-level attribute of a resource change. It renders either as aligned Leaves (scalars, small structural diffs, sensitive/unknown) or, when large, as a foldable block carrying the Variant ladder fit degrades.
func (Field) AtLast ¶ added in v0.2.0
AtLast reports whether the selected block variant is the least-detail one.
type Leaf ¶ added in v0.2.0
type Leaf struct {
Op LeafOp
Path string // dotted, includes the attribute name (e.g. "labels.team")
Old string // rendered scalar; used for change/remove
New string // rendered scalar; used for add/change
Inline string // when set, rendered verbatim instead of Old/New (e.g. "(sensitive value)")
}
Leaf is one aligned `op path = value` row.
type LeafOp ¶ added in v0.2.0
type LeafOp uint8
LeafOp is the change kind for a single leaf attribute path.
type RenderMode ¶
type RenderMode int
RenderMode is the terminal-cascade level chosen by fit.
const ( ModeFull RenderMode = iota // table + per-stack details ModeSummaryOnly // table + notice, no details ModeMinimal // one-line aggregate + notice )
type Report ¶
type Report struct {
Title string
Marker string
Classified bool // whether to show the Categories column
Default Class // fallback badge shown for a stack that matched no category
Stacks []Stack
Mode RenderMode
Notice string // cascade notice (set by fit when degrading)
DetailsOpen bool // render <details open> when true
HeaderLinks []Link
}
Report is the complete intermediate model.