parser

package
v0.27.1-0...-5af25ad Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Functions

func Functions(baseDir string) map[string]function.Function

Functions returns the set of functions that should be used to when evaluating expressions in the receiving scope.

Types

type Attribute

type Attribute struct {
	// contains filtered or unexported fields
}

func NewAttribute

func NewAttribute(attr *hclsyntax.Attribute, ctx *hcl.EvalContext) *Attribute

func (*Attribute) IsLiteral

func (attr *Attribute) IsLiteral() bool

func (*Attribute) Name

func (attr *Attribute) Name() string

func (*Attribute) Range

func (attr *Attribute) Range() Range

func (*Attribute) Type

func (attr *Attribute) Type() cty.Type

func (*Attribute) Value

func (attr *Attribute) Value() cty.Value

type Block

type Block struct {
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(hclBlock *hcl.Block, ctx *hcl.EvalContext) *Block

func (*Block) GetAttribute

func (block *Block) GetAttribute(name string) *Attribute

func (*Block) GetAttributes

func (block *Block) GetAttributes() []*Attribute

func (*Block) GetBlock

func (block *Block) GetBlock(name string) *Block

func (*Block) GetBlocks

func (block *Block) GetBlocks(name string) Blocks

func (*Block) Labels

func (block *Block) Labels() []string

func (*Block) Name

func (block *Block) Name() string

func (*Block) Range

func (block *Block) Range() Range

func (*Block) Type

func (block *Block) Type() string

type Blocks

type Blocks []*Block

func (Blocks) OfType

func (blocks Blocks) OfType(t string) Blocks

func (Blocks) RemoveDuplicates

func (blocks Blocks) RemoveDuplicates() Blocks

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is a tool for parsing terraform templates at a given file system location

func New

func New() *Parser

New creates a new Parser

func (*Parser) ParseDirectory

func (parser *Parser) ParseDirectory(path string) (Blocks, error)

ParseDirectory recursively parses all terraform files within a given directory

type Range

type Range struct {
	Filename  string `json:"filename"`
	StartLine int    `json:"start_line"`
	EndLine   int    `json:"end_line"`
}

Range describes an area of code, including the filename it is present in and the lin numbers the code occupies

func (*Range) String

func (r *Range) String() string

String creates a human-readable summary of the range

Jump to

Keyboard shortcuts

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