parser

package
v1.223.1-rc.1 Latest Latest
Warning

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

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

Documentation

Overview

Package parser owns the grammars used by Atmos configuration functions.

It deliberately parses only function arguments. YAML parsing, 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

This section is empty.

Types

type EnvArgs

type EnvArgs struct {
	Name    string
	Default string
}

EnvArgs contains an environment variable name and its optional default value.

func ParseEnv

func ParseEnv(input string) (EnvArgs, error)

ParseEnv parses `name [default]`.

type Error

type Error struct {
	Position Position
	Message  string
}

Error describes an invalid function-argument grammar.

func (*Error) Error

func (e *Error) Error() string

Error implements error.

type IncludeArgs

type IncludeArgs struct {
	Path  string
	Query string
}

IncludeArgs contains an include target and its optional YQ query.

func ParseInclude

func ParseInclude(input string) (IncludeArgs, error)

ParseInclude parses `path [query]` and preserves whitespace in the query.

type Position

type Position struct {
	Offset int
	Line   int
	Column int
}

Position identifies a byte position in function arguments.

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 StoreArgs

type StoreArgs struct {
	Store     string
	Stack     string
	Component string
	Key       string
	Default   *string
	Query     string
}

StoreArgs contains the parsed !store arguments.

func ParseStore

func ParseStore(input string) (StoreArgs, error)

ParseStore parses !store arguments and their optional default/query clauses.

type StoreGetArgs

type StoreGetArgs struct {
	Store   string
	Key     string
	Default *string
	Query   string
}

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

type TerraformArgs struct {
	Component  string
	Stack      string
	Expression string
}

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`.

Jump to

Keyboard shortcuts

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