yaml

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package yaml is the YAML frontend: parses YAML workflows into the ir.Workflow IR. The decode path is YAML → any (goccy) → JSON (stdlib) → IR (the existing JSON unmarshalers in ir/), reusing the key-presence Node dispatch, the standard-surface Skip and Parallel marshalers, Duration's string/integer forms, and the digest-stable map-key ordering — without duplicating any of that.

Parse-time errors from goccy carry line:column inside *goccy/go-yaml/errors.SyntaxError (reachable via errors.As), so callers can surface position-aware diagnostics for YAML syntax issues. Position-aware SEMANTIC diagnostics (e.g. "field X at line Y is invalid") are deferred — a re-parse of the YAML AST by future validation would recover them when needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(yamlBytes []byte) (*ir.Workflow, error)

Decode parses a YAML workflow document into an *ir.Workflow. The returned error wraps goccy's parse error (with line:column) on syntax failures; downstream errors include the failing stage for attribution.

func DecodeWithRaw added in v0.3.0

func DecodeWithRaw(yamlBytes []byte) (*ir.Workflow, map[string]any, error)

DecodeWithRaw parses a YAML workflow document into an *ir.Workflow, same as Decode, and also returns the top-level raw mapping from stage 1 of the decode pipeline (nil if the document's top level isn't a mapping). The raw tree lets a validator detect keys/values the typed unmarshal silently discarded — Decode itself doesn't need it, so it stays a thin wrapper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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