config

package
v0.2.0-alpha Latest Latest
Warning

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

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

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

func (l *ProfileLoader) LoadProfileFromReader(r io.Reader) (*entities.Profile, error)

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.

Jump to

Keyboard shortcuts

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