Documentation
¶
Index ¶
- func Clean(cfg *config.DuckConf, targetName string) error
- func Exec(cfg *config.DuckConf, targetName string, passthrough []string, ...) error
- func Sync(cfg *config.DuckConf, targetName string, force bool, ...) error
- func TestGetCloneFunc() func(string, string, string, bool) (string, error)
- func TestGetExecCommand() func(string, ...string) *exec.Cmd
- func TestSetCloneFunc(f func(string, string, string, bool) (string, error))
- func TestSetExecCommand(f func(string, ...string) *exec.Cmd)
- type PrepareTemplateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶ added in v0.1.0
Clean removes cached objects and per-target working dirs. If targetName is empty, purge everything. Otherwise, clean only that target’s cache and its currently referenced object.
func Exec ¶
func Exec(cfg *config.DuckConf, targetName string, passthrough []string, securityCfg *config.SecurityConfig, trackCommitHashFlag *bool, autoUpdateOnChangeFlag *bool) error
Exec renders and executes one target.
This function uses the shared prepareAndRenderTemplate function for template processing (variable resolution, caching, checksum validation, etc.) and then executes the target's binary with the rendered template.
func Sync ¶ added in v0.1.0
func Sync(cfg *config.DuckConf, targetName string, force bool, securityCfg *config.SecurityConfig, trackCommitHashFlag *bool, autoUpdateOnChangeFlag *bool) error
Sync renders templates into the cache without executing the target. If targetName is empty, all targets (default + named) are synced. If force is true, re-render regardless of existing cache.
This function now shares the same template preparation logic as Exec, including checksum validation, through the prepareAndRenderTemplate function.
func TestGetCloneFunc ¶ added in v0.1.0
TestGetCloneFunc returns the current cloneFunc seam.
func TestGetExecCommand ¶ added in v0.1.0
TestGetExecCommand exposes current execCommand seam.
func TestSetCloneFunc ¶ added in v0.1.0
TestSetCloneFunc overrides the internal cloneFunc seam for external (cmd package) tests.
Types ¶
type PrepareTemplateResult ¶ added in v0.6.1
type PrepareTemplateResult struct { ObjFile string // Path to rendered object file LinkPath string // Path where symlink should point OldRenderedKey string // Previous rendered cache key (for cleanup) RenderedKey string // Current rendered cache key RemoteKey string // Remote cache key (stable for repo/ref/path) // New fields for environment variables RepoPath string // Path to cloned repository RepoURL string // Repository URL RepoRef string // Git reference used TemplatePath string // Source template file path TargetName string // Target name being executed CacheDir string // Per-target cache directory }
PrepareTemplateResult holds the results of template preparation shared between Exec and Sync operations