Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrParseFailure = errors.New("parse failure error")
ErrParseFailure is returned by parser.Parse when the input string is unable to be parsed.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct {
Key *string `parser:"@(Ident { \".\" | \"#\" | \"%\" | \"~\" | \"/\" | \"-\" | Ident | Float }) \":\""`
Before *string `parser:"((@String \"=\" \">\""`
After *string `parser:" (@String"`
AfterComputed *string `parser:" | @(\"<\" Ident \">\")))"`
Value *string `parser:" | @String"`
Computed *string `parser:" | @(\"<\" Ident \">\"))"`
NewResource bool `parser:"{ @(\"(\" \"forces\" \"new\" \"resource\" \")\") }"`
// contains filtered or unexported fields
}
The Attribute struct is responsible for parsing the attributes of each resource displayed by Terraform plan output.
Examples:
`id: <computed>` `policy_arn: "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"`` `allow_overwrite: "" => "true"`
type Header ¶
type Header struct {
Change *string `parser:"@(\"-\" \"/\" \"+\" | \"<\" \"=\" | \"+\" | \"-\" | \"~\")"`
Name *string `parser:"@(Ident { (\".\" | \"-\") (Ident | Int)+ | \"[\" Int \"]\" })"`
Taint bool `parser:"{ @(\"(\" \"tainted\" \")\") }"`
NewResource bool `parser:"{ @(\"(\" \"new\" \"resource\" \"required\" \")\") }"`
// contains filtered or unexported fields
}
The Header struct is responsible for parsing the header of each resource displayed by Terraform plan output.
Examples:
`+ aws_route53_record.record` `-/+ module.module_name (new resource required)`
type Metadata ¶
type Metadata struct {
Add int `parser:"@Int \"to\" \"add\" \",\""`
Change int `parser:"@Int \"to\" \"change\" \",\" "`
Destroy int `parser:"@Int \"to\" \"destroy\" \".\" "`
// contains filtered or unexported fields
}
The Metadata struct is responsible for parsing the plan metadata that displays the summary statistics from the Terraform plan output.
Example:
`Plan: 2 to add, 0 to change, 0 to destroy.`
type Plan ¶
type Plan struct {
Warnings *[]string
Resources []*Resource `parser:"{@@}"`
Metadata *Metadata `parser:"{@@}"`
NoChanges bool
// contains filtered or unexported fields
}
The Plan struct is the root of the AST grammar used to parse the Terraform plan output.
type Resource ¶
type Resource struct {
Header *Header `parser:"@@"`
Attributes []*Attribute `parser:"{ @@ }"`
// contains filtered or unexported fields
}
The Resource struct is responsible for parsing each resource group that is displayed by the Terraform plan output. A resource comprises of a single Header and as many optional Attributes.
type SceneryDefinition ¶
type SceneryDefinition struct{}
SceneryDefinition is a copy of participles default Definition lexer with the modification that new lines are not ignored.
func (*SceneryDefinition) Lex ¶
Lex an io.Reader with text/scanner.Scanner.
This provides very fast lexing of source code compatible with Go tokens.
Note that this differs from text/scanner.Scanner in that string tokens will be unquoted and new lines are not ignored.
func (*SceneryDefinition) Symbols ¶
func (d *SceneryDefinition) Symbols() map[string]rune
Symbols returns a map of the tokens type symbols