Documentation
¶
Overview ¶
Package parser owns the grammars used by Atmos configuration functions.
It parses function arguments and encodes their tagged YAML forms for deferred evaluation. Stack document loading, template rendering, and expression evaluation remain the responsibility of their existing layers. Callers receive typed argument values and can apply execution-context defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeCILabels ¶
EncodeCILabels validates tagged YAML arguments and encodes a deferred function expression. Sequence arguments must be preserved explicitly because their node.Value is empty.
func ParseCILabels ¶
ParseCILabels accepts no arguments (list mode) or a nonempty YAML sequence of literal strings. A nil result distinguishes list mode from membership matching.
Types ¶
type IncludeArgs ¶
type IncludeArgs struct {
Path string
Query string
// Eval reports the trailing `| eval` option: YAML functions inside the
// included file are evaluated instead of being included as data.
Eval bool
}
IncludeArgs contains an include target and its optional YQ query.
func ParseInclude ¶
func ParseInclude(input string) (IncludeArgs, error)
ParseInclude parses `path [query] [| eval]` and preserves whitespace in the query. The only option !include accepts is the valueless `eval`; a pipe that is not followed by it belongs to the yq query (`.items[] | select(.enabled)`).
type LabelsArgs ¶ added in v1.229.0
LabelsArgs selects the full label map (Key == nil), or a literal key with an optional fallback. A pointer distinguishes an empty fallback from none.
func ParseLabels ¶ added in v1.229.0
func ParseLabels(input string) (LabelsArgs, error)
ParseLabels parses `[key [default]]` using the shared argument quoting rules.
type RandomArgs ¶
type RandomArgs struct {
Values []string
}
RandomArgs contains the optional minimum and maximum random values as source text.
func ParseRandom ¶
func ParseRandom(input string) (RandomArgs, error)
ParseRandom parses zero, one, or two integer source values.
type SecretArgs ¶ added in v1.229.0
SecretArgs contains a declared secret name and its optional modifiers.
func ParseSecret ¶ added in v1.229.0
func ParseSecret(input string) (SecretArgs, error)
ParseSecret parses `name [| path expression | raw] [| default value]`.
type StoreArgs ¶
type StoreArgs struct {
Store string
Stack string
Component string
Key string
Default *string
Query string
}
StoreArgs contains the parsed !store arguments.
func ParseStore ¶
ParseStore parses !store arguments and their optional default/query clauses.
type StoreGetArgs ¶
StoreGetArgs contains the parsed !store.get arguments.
func ParseStoreGet ¶
func ParseStoreGet(input string) (StoreGetArgs, error)
ParseStoreGet parses !store.get arguments and optional default/query clauses.
type TerraformArgs ¶
TerraformArgs is the parsed form of `component [stack] expression`. An empty Stack means the caller should use the execution-context stack.
func ParseTerraform ¶
func ParseTerraform(input string) (TerraformArgs, error)
ParseTerraform parses `component [stack] expression`.