Documentation
¶
Index ¶
- func BuildToolchainPATH(atmosConfig *schema.AtmosConfiguration, dependencies map[string]string) (string, error)
- func MergeDependencies(parent map[string]string, child map[string]string) (map[string]string, error)
- func UpdatePathForTools(atmosConfig *schema.AtmosConfiguration, dependencies map[string]string) error
- func ValidateConstraint(version string, constraint string) error
- type InstallFunc
- type Installer
- type InstallerOption
- type Resolver
- func (r *Resolver) ResolveCommandDependencies(command *schema.Command) (map[string]string, error)
- func (r *Resolver) ResolveComponentDependencies(componentType string, stackConfig map[string]any, ...) (map[string]string, error)
- func (r *Resolver) ResolveWorkflowDependencies(workflowDef *schema.WorkflowDefinition) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildToolchainPATH ¶
func BuildToolchainPATH(atmosConfig *schema.AtmosConfiguration, dependencies map[string]string) (string, error)
BuildToolchainPATH constructs a PATH string with toolchain binaries prepended. This function does NOT modify the global environment - it returns the PATH string which should be added to ComponentEnvList for subprocess execution.
func MergeDependencies ¶
func MergeDependencies(parent map[string]string, child map[string]string) (map[string]string, error)
MergeDependencies merges child dependencies into parent with constraint validation. Child values override parent values, but must satisfy parent constraints.
func UpdatePathForTools ¶
func UpdatePathForTools(atmosConfig *schema.AtmosConfiguration, dependencies map[string]string) error
UpdatePathForTools updates PATH environment variable to include tool binaries. Deprecated: Use BuildToolchainPATH() instead and add to ComponentEnvList. This function is kept for backwards compatibility but should not be used.
func ValidateConstraint ¶
ValidateConstraint validates that a specific version satisfies a constraint.
Types ¶
type InstallFunc ¶
InstallFunc is the function signature for installing a tool.
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer handles automatic tool installation.
func NewInstaller ¶
func NewInstaller(atmosConfig *schema.AtmosConfiguration, opts ...InstallerOption) *Installer
NewInstaller creates a new tool installer.
type InstallerOption ¶
type InstallerOption func(*Installer)
InstallerOption is a functional option for configuring Installer.
func WithFileExistsFunc ¶
func WithFileExistsFunc(fn func(path string) bool) InstallerOption
WithFileExistsFunc sets a custom file exists function (for testing).
func WithInstallFunc ¶
func WithInstallFunc(fn InstallFunc) InstallerOption
WithInstallFunc sets a custom install function (for testing).
func WithResolver ¶
func WithResolver(resolver toolchain.ToolResolver) InstallerOption
WithResolver sets a custom ToolResolver (for testing).
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves tool dependencies with inheritance and validation.
func NewResolver ¶
func NewResolver(atmosConfig *schema.AtmosConfiguration) *Resolver
NewResolver creates a new dependency resolver.
func (*Resolver) ResolveCommandDependencies ¶
ResolveCommandDependencies resolves tool dependencies for a custom command.
func (*Resolver) ResolveComponentDependencies ¶
func (r *Resolver) ResolveComponentDependencies( componentType string, stackConfig map[string]any, componentConfig map[string]any, ) (map[string]string, error)
ResolveComponentDependencies resolves tool dependencies for a component. Merges 3 scopes from stack configuration (lowest to highest priority):
- Global scope: top-level dependencies
- Component type scope: terraform.dependencies / helmfile.dependencies / packer.dependencies
- Component instance scope: components.terraform.vpc.dependencies
Parameters:
- componentType: "terraform", "helmfile", or "packer"
- stackConfig: Full merged stack configuration (includes all scopes)
- componentConfig: Merged component configuration
func (*Resolver) ResolveWorkflowDependencies ¶
func (r *Resolver) ResolveWorkflowDependencies(workflowDef *schema.WorkflowDefinition) (map[string]string, error)
ResolveWorkflowDependencies resolves tool dependencies for a workflow.