config

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config handles configuration file parsing and management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandPath

func ExpandPath(path string) string

ExpandPath expands ~ and environment variables in a path

func GetDefaultSpecPath

func GetDefaultSpecPath() string

GetDefaultSpecPath returns the default spec file path

func GetDeployDir

func GetDeployDir() string

GetDeployDir returns the deployment output directory

func GetSpecAliasPath

func GetSpecAliasPath() string

GetSpecAliasPath returns the accepted TechStack/user-intent alias path.

Types

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader handles loading configuration files

func NewLoader

func NewLoader(basePath string) *Loader

NewLoader creates a new configuration loader

func (*Loader) DiscoverStackKits

func (l *Loader) DiscoverStackKits(dirs ...string) ([]*models.StackKit, error)

DiscoverStackKits scans directories for stackkit.yaml files and returns loaded StackKits. It scans the given directories in order and deduplicates by name.

func (*Loader) FindStackKitDir

func (l *Loader) FindStackKitDir(name string) (string, error)

FindStackKitDir finds the stackkit directory for a given name

func (*Loader) LoadDeploymentState

func (l *Loader) LoadDeploymentState(path string) (*models.DeploymentState, error)

LoadDeploymentState loads the deployment state file

func (*Loader) LoadLegacyStackSpec

func (l *Loader) LoadLegacyStackSpec(path string) (*models.StackSpec, error)

LoadLegacyStackSpec loads only a classified StackSpec v1 document. It rejects v2 before decoding through models.StackSpec and rejects unknown v1 fields so a later Save cannot silently erase operator intent.

func (*Loader) LoadStackKit

func (l *Loader) LoadStackKit(path string) (*models.StackKit, error)

LoadStackKit loads a stackkit.yaml file

func (*Loader) LoadStackSpec

func (l *Loader) LoadStackSpec(path string) (*models.StackSpec, error)

LoadStackSpec is the v0.6 compatibility name for the legacy-only loader. Deprecated: new code must call ReadStackSpecDocument and route by version. Legacy compatibility code should call LoadLegacyStackSpec explicitly.

stack-spec.yaml remains the canonical CLI file. If the caller asks for the canonical default and it is missing, kombination.yaml is accepted as a user-intent alias for TechStack/CLI interoperability.

func (*Loader) ReadStackSpecDocument

func (l *Loader) ReadStackSpecDocument(path string) (StackSpecDocument, error)

ReadStackSpecDocument loads and strictly classifies a StackSpec without applying legacy defaults or discarding fields. New operational readers must start here and then route explicitly by Document.Version.

func (*Loader) ResolveStackSpecPathForRead

func (l *Loader) ResolveStackSpecPathForRead(path string) (string, string, bool, error)

ResolveStackSpecPathForRead resolves the spec path and reports whether the TechStack/user-intent alias was selected.

func (*Loader) SaveDeploymentState

func (l *Loader) SaveDeploymentState(state *models.DeploymentState, path string) error

SaveDeploymentState saves the deployment state file

func (*Loader) SaveLegacyStackSpecV06

func (l *Loader) SaveLegacyStackSpecV06(spec *models.StackSpec, path string) error

SaveLegacyStackSpecV06 persists the bounded models.StackSpec compatibility document. Callers must enforce the exact v0.6 build admission before using this serializer; canonical v2 bytes must never pass through this model.

type StackSpecDocument

type StackSpecDocument struct {
	Path        string
	DisplayPath string
	AliasUsed   bool
	Document    stackspecmigration.Document
}

StackSpecDocument is the lossless, version-classified StackSpec read boundary. Raw bytes remain owned by stackspecmigration.Document so callers cannot accidentally decode v2 through the partial legacy Go model.

Jump to

Keyboard shortcuts

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