Documentation
¶
Overview ¶
Package loader reads a atago YAML file and turns it into a validated *spec.Spec. Validation happens in layers: YAML parse, then schema/semantic checks. Errors carry the file path and, for parse failures, the line/column reported by goccy/go-yaml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Kind ¶
type Kind int
Kind classifies why loading failed, so callers can map it to an exit code (exit 2 = spec parse error).
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source resolves stable source locations (line and column) for the declarations in a spec file, so tooling can jump from a manifest entry straight to the authored YAML (#80). It is built from the same bytes the spec was decoded from and answers queries by YAML path against the parsed AST.
A location is 1-based and points at the value token for the queried node (for a scenario, the `name:` value; for a step, the step mapping). When a path cannot be resolved — e.g. an optional block is absent — the position is zero, which callers treat as "unknown" and omit.
func LoadWithSource ¶
LoadWithSource loads and validates the spec at path and also returns a Source locator for it. The spec is identical to what Load returns; the extra Source exposes authored line/column positions. A parse error for the position AST is non-fatal (the spec already decoded), so Source methods simply report unknown.
func (*Source) ScenarioPos ¶
ScenarioPos returns the location of the authored scenario at authoredIndex (its pre-matrix-expansion index). Every instance expanded from one matrix template shares this location.