Documentation
¶
Index ¶
- Variables
- func Check(file, tmplPath, against string, preferSSH bool, cliVars map[string]string)
- func DoctorCheck(fix bool, verbose bool)
- func EncryptFile(filePath string, passwordID string)
- func Export(file string, format string, output string, preferSSH bool)
- func Get(file, action, key string, preferSSH bool, cliVars map[string]string)
- func PrintDiff(blueprintFile string, preferSSH bool)
- func PrintHistory(runNumber int, stepNumber int, since, blueprintFilter string)
- func PrintHistoryStats(since, blueprintFilter string)
- func PrintPS()
- func PrintSlow(topN int)
- func PrintStatus()
- func Render(file, tmplPath, output string, preferSSH bool, cliVars map[string]string)
- func RenderWithRules(rules []parser.Rule, tmplPath, output string, preferSSH bool, ...) error
- func Run(file string, dry bool) int
- func RunWithSkip(file string, dry bool, skipGroup string, skipID string, onlyID string, ...) int
- func Validate(file string, preferSSH bool)
- type ExecutionRecord
- type ProcessState
- type RealCommandExecutor
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
var ExecutableName = "blueprint"
ExecutableName is the name to use in user-facing command hints (e.g. "Run to fix"). Defaults to "blueprint"; set to "go run ./cmd/blueprint" when running via go run.
Functions ¶
func Check ¶
Check parses a blueprint, renders tmplPath (file or directory), and compares each rendered result against the corresponding committed file. against is a file path in single-file mode, or a directory root in directory mode. In directory mode with no --against, targets are resolved next to each template. Exits 0 when all are identical, 1 when any differ.
func DoctorCheck ¶
DoctorCheck reads ~/.blueprint/status.json, reports all issues found, and optionally rewrites the file with issues fixed when fix is true. When verbose is true, prints progress messages for each check as it runs. Exits with code 1 if issues are found and fix is false.
func EncryptFile ¶
func Export ¶
Export generates a shell script from a blueprint file. format is "bash" or "sh". output is "" for stdout or a file path.
func PrintDiff ¶
PrintDiff compares the desired state in the blueprint file against the installed state in status.json and prints what would be added or removed on the next apply.
func PrintHistory ¶
PrintHistory displays the history of a specific run If runNumber is 0, displays the latest run If stepNumber is >= 0, displays only that specific step since and blueprintFilter are optional filters applied to the run listing.
func PrintHistoryStats ¶
func PrintHistoryStats(since, blueprintFilter string)
PrintHistoryStats prints aggregate stats from history, optionally filtered.
func PrintSlow ¶
func PrintSlow(topN int)
PrintSlow displays the slowest rule executions from history. topN limits the results (default 10). If lastOnly is true, only the latest run is shown.
func PrintStatus ¶
func PrintStatus()
func Render ¶
Render parses a blueprint and renders tmplPath (file or directory) against it. When tmplPath is a directory all *.tmpl files are rendered recursively; files whose basename starts with "_" are skipped. output is used only for single-file mode ("" → stdout, path → file).
func RenderWithRules ¶
func RenderWithRules(rules []parser.Rule, tmplPath, output string, preferSSH bool, cliVars map[string]string) error
RenderWithRules renders tmplPath using pre-parsed rules. Used by the render blueprint action so the rules don't need to be re-parsed from a file.
func RunWithSkip ¶
func RunWithSkip(file string, dry bool, skipGroup string, skipID string, onlyID string, skipDecrypt bool, preferSSH bool, noStatus bool, cliVars map[string]string) int
RunWithSkip executes the blueprint and returns an exit code: 0 = success (all rules applied or dry-run completed), 1 = one or more rules failed or a fatal error occurred.
Types ¶
type ExecutionRecord ¶
type ExecutionRecord struct {
Timestamp string `json:"timestamp"`
Blueprint string `json:"blueprint"`
OS string `json:"os"`
Command string `json:"command"`
Status string `json:"status"`
DurationMs int64 `json:"duration_ms,omitempty"`
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
}
type ProcessState ¶
type ProcessState struct {
PID int `json:"pid"`
BlueprintFile string `json:"blueprint_file"`
OS string `json:"os"`
TotalRules int `json:"total_rules"`
CurrentRule int `json:"current_rule"`
CurrentAction string `json:"current_action"`
HandlerState map[string]string `json:"handler_state,omitempty"`
StartedAt string `json:"started_at"`
RuleStartedAt string `json:"rule_started_at"`
}
ProcessState represents the current execution state written to ~/.blueprint/ps.json
type RealCommandExecutor ¶
type RealCommandExecutor struct{}
RealCommandExecutor implements platform.CommandExecutor for production use
type TemplateData ¶
type TemplateData = renderer.TemplateData
TemplateData is a type alias for renderer.TemplateData to preserve the engine package's public API for any callers that use engine.BuildTemplateData.
func BuildTemplateData ¶
func BuildTemplateData(rules []parser.Rule, cliVars map[string]string) *TemplateData
BuildTemplateData constructs a TemplateData from a slice of rules. cliVars are values passed via --var KEY=VALUE and take precedence over defaults defined in the blueprint.