dependencies

package
v1.203.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

func ValidateConstraint(version string, constraint string) error

ValidateConstraint validates that a specific version satisfies a constraint.

Types

type InstallFunc

type InstallFunc func(toolSpec string, setAsDefault, reinstallFlag bool) error

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.

func (*Installer) EnsureTools

func (i *Installer) EnsureTools(dependencies map[string]string) error

EnsureTools ensures all required tools are installed. Installs missing tools automatically.

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

func (r *Resolver) ResolveCommandDependencies(command *schema.Command) (map[string]string, error)

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):

  1. Global scope: top-level dependencies
  2. Component type scope: terraform.dependencies / helmfile.dependencies / packer.dependencies
  3. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL