Documentation
¶
Overview ¶
Package config provides infrastructure for loading profile configurations. This package handles YAML parsing, file I/O, and variable substitution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProfileLoader ¶
type ProfileLoader struct{}
ProfileLoader handles loading profiles from YAML files.
func NewProfileLoader ¶
func NewProfileLoader() *ProfileLoader
NewProfileLoader creates a new profile loader.
func (*ProfileLoader) LoadProfile ¶
func (l *ProfileLoader) LoadProfile(path string) (*entities.Profile, error)
LoadProfile loads and parses a profile from a YAML file. It applies control defaults and validates the profile structure.
func (*ProfileLoader) LoadProfileFromReader ¶
LoadProfileFromReader loads a profile from an io.Reader.
type VariableSubstitutor ¶
type VariableSubstitutor struct{}
VariableSubstitutor performs variable substitution in profiles.
func NewVariableSubstitutor ¶
func NewVariableSubstitutor() *VariableSubstitutor
NewVariableSubstitutor creates a new variable substitutor.
func (*VariableSubstitutor) Substitute ¶
func (s *VariableSubstitutor) Substitute(profile *entities.Profile) error
Substitute performs simple variable substitution in a profile. It replaces {{ .vars.key }} patterns with values from the profile's vars map. Supports nested paths like {{ .vars.paths.config }}. Returns an error if a referenced variable is not found. Modifies the profile in place.