Documentation
¶
Overview ¶
Package yamlsource preserves explicit YAML function identity across the string-valued fields and serialization boundaries in the configuration pipeline. It has no dependency on configuration or evaluators.
Index ¶
Constants ¶
const BehaviorKey = "yaml_functions.explicit_tags"
BehaviorKey identifies the edition transition for automatic YAML function evaluation.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains reports whether text includes loader-preserved source, including expressions interpolated into a larger string without evaluation.
func ContainsTag ¶
ContainsTag reports whether text embeds source for a tag, as can happen when a template interpolates a computed value into a stack name.
func Display ¶
Display returns an ordinary representation for output formats without YAML tags. Internal JSON cloning should retain the transport strings instead.
func Expression ¶
Expression unwraps a transported value for an explicit evaluator.
func RestoreTags ¶
RestoreTags restores explicit tags for public YAML output and YAML template passes. Plain strings, including quoted function expressions, are unchanged.
Types ¶
type Source ¶
type Source struct {
Tag string `json:"tag"`
Argument string `json:"-"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
}
Source identifies an explicit tag and its original scalar argument.
func (Source) Encode ¶
Encode transports source through existing string fields. The argument stays readable so template rendering can operate on it without losing tag identity.
func (Source) Expression ¶
Expression returns the spelling accepted by explicit evaluation APIs.