Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conflict ¶
Conflict describes a directive changed by both the user (via `comquad edit`) and by compose.yaml regeneration. The user's value wins; the conflict is reported so nothing is silently dropped.
func MergeUnit ¶
func MergeUnit(base, disk, new c2q.QuadletUnit) (c2q.QuadletUnit, []Conflict)
MergeUnit performs a directive-level three-way merge of a generated quadlet unit and its on-disk counterpart, using the previously generated content as the common base. On conflict the user's (disk) value wins and the conflict is returned. The merged unit always adopts the type and name of new.
type FilePlan ¶
type FilePlan struct {
Name string
TargetPath string
BasePath string
Status FileStatus
OldContent string
OldTargetExists bool
OldBaseline string
OldBaselineExists bool
NewContent string
BaselineContent string
NoBaseline bool
Conflicts []Conflict
}
FilePlan describes what will happen to a single quadlet file.
type FileStatus ¶
type FileStatus int
FileStatus classifies how a generated unit relates to what is on disk.
const ( StatusUnchanged FileStatus = iota StatusCreated StatusChanged StatusRemoved )
type Plan ¶
Plan is a read-only preview of a reconcile pass.
func Compute ¶
func Compute(targetDir, baselineDir, prefix string, units []c2q.QuadletUnit) (Plan, error)
Compute builds a Plan describing the changes needed without touching disk.
func (Plan) Diff ¶
Diff renders a unified diff of the plan for user display. It covers created, changed, and removed files; unchanged files produce no output.
func (Plan) HasChanges ¶
HasChanges reports whether applying the plan would modify anything.
type Result ¶
type Result struct {
Created []string // files that did not exist and were written
Changed []string // existing files whose content changed and were rewritten
Removed []string // stale target files removed (no longer generated)
NoBaseline []string // files overwritten without a baseline (2-way fallback)
Conflicts []Conflict
}
Result summarizes a Reconcile pass.