Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultConfig aliases model.DefaultConfig. DefaultConfig = model.DefaultConfig // NewContext aliases model.NewContext. NewContext = model.NewContext // WithFS aliases model.WithFS. WithFS = model.WithFS // WithSyntax aliases model.WithFS. WithSyntax = model.WithSyntax // ParseDocument aliases frontmatter.ParseDocument. ParseDocument = frontmatter.ParseDocument )
Model function/value aliases.
Functions ¶
func MapMatchesSpec ¶
MapMatchesSpec checks if a map contains all key:value pairs from a specification map. Used for matrix include/exclude matching and other spec-based filtering. Returns true only if every key in spec exists in the map with an equal value.
func ValuesEqual ¶
ValuesEqual checks if two values are equal, handling primitives and type coercion. Used for comparing values in matrix specs where YAML may parse numbers as float64 or int.
Types ¶
type ContextOptions ¶
type ContextOptions = model.ContextOptions
ContextOptions aliases model.ContextOptions.
type DirectiveHandler ¶
type DirectiveHandler = model.DirectiveHandler
DirectiveHandler aliases model.DirectiveHandler.
type DocumentContent ¶
type DocumentContent = frontmatter.DocumentContent
DocumentContent aliases frontmatter.DocumentContent.
type Expr ¶
type Expr struct {
// contains filtered or unexported fields
}
Expr evaluates YAML documents with variable interpolation, conditionals, and composition.
func New ¶
func New(rootFS fs.FS, opts ...ConfigOption) *Expr
New creates a new Expr evaluator with the given filesystem for includes. Optional ConfigOption arguments can be passed to customize directive syntax.
func (*Expr) Load ¶
Load loads a YAML file and processes it with expression evaluation. Returns a slice of Documents. For root-level for: or similar directives, may return multiple documents. For regular documents, returns a single-item slice. The filename is resolved relative to the filesystem provided to New().
type ForLoopExpr ¶
type ForLoopExpr struct {
// Variables is a list of variable names to bind. Can include "_" to omit.
Variables []string
// Source is the name of the variable to iterate over.
Source string
}
ForLoopExpr represents a parsed for loop expression.
type MatrixDirective ¶
type MatrixDirective struct {
// Dimensions contains array values that form the cartesian product.
Dimensions map[string][]any
// Variables contains non-array values to add to each combination.
Variables map[string]any
// Include specifies additional custom combinations to add.
Include []map[string]any
// Exclude specifies combinations to filter out from the product.
Exclude []map[string]any
}
MatrixDirective represents the parsed matrix configuration Fields are exported for testing purposes.