Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface {
Execute(ctx context.Context, execCtx *ExecutionContext) error
}
Action is the interface that all operation types implement.
type ActionFactory ¶
type ActionFactory func() Action
ActionFactory creates an Action from raw operation config.
type CommitPushAction ¶
type CommitPushAction struct {
Config config.CommitPush
}
CommitPushAction commits all changes and pushes to the remote.
func (*CommitPushAction) Execute ¶
func (a *CommitPushAction) Execute(ctx context.Context, execCtx *ExecutionContext) error
type ExecutionContext ¶
type ExecutionContext struct {
// ModuleDir is the path to the module directory containing loom.yaml.
ModuleDir string
// TargetDir is the path to the target repository working directory.
TargetDir string
// Params are the resolved template parameters.
Params map[string]string
// Excludes are glob patterns for files/dirs to exclude from template walking.
Excludes []string
// Includes are glob patterns that override excludes (including implicit ones).
Includes []string
// DryRun indicates whether to simulate operations.
DryRun bool
// Logger is the structured logger.
Logger *slog.Logger
}
ExecutionContext holds runtime state shared across actions.
type NewFilesAction ¶
NewFilesAction renders template files from the module directory and writes them to the target directory.
func (*NewFilesAction) Execute ¶
func (a *NewFilesAction) Execute(ctx context.Context, execCtx *ExecutionContext) error
type PatchAction ¶
PatchAction applies patch operations to a target YAML file using the kustomize library. Two engines are supported:
- "smp" (default): Strategic Merge Patch — a partial YAML document deep-merged into the target.
- "json6902": RFC 6902 JSON Patch — an explicit list of add/remove/replace/move/copy/test operations.
func (*PatchAction) Execute ¶
func (a *PatchAction) Execute(ctx context.Context, execCtx *ExecutionContext) error
type ShellAction ¶
ShellAction runs a shell command on the host.
func (*ShellAction) Execute ¶
func (a *ShellAction) Execute(ctx context.Context, execCtx *ExecutionContext) error