package
0.0.0-20191002203319-fb75b3253c80
Repository: https://github.com/hashicorp/hcl2.git
Documentation: pkg.go.dev

# Packages

line scan_tokens.rl:1.
Package integrationtest is an internal package that contains some tests that attempt to exercise many HCL features together in realistic scenarios.
Package json is the JSON parser for HCL.

# Functions

AbsTraversalForExpr attempts to interpret the given expression as an absolute traversal, or returns error diagnostic(s) if that is not possible for the given expression.
ApplyPath is a helper function that applies a cty.Path to a value using the indexing and attribute access operations from HCL.
EmptyBody returns a body with no content.
ExprAsKeyword attempts to interpret the given expression as a static keyword, returning the keyword string if possible, and the empty string if not.
ExprCall tests if the given expression is a function call and, if so, extracts the function name and the expressions that represent the arguments.
ExprList tests if the given expression is a static list construct and, if so, extracts the expressions that represent the list elements.
ExprMap tests if the given expression is a static map construct and, if so, extracts the expressions that represent the map elements.
GetAttr is a helper function that performs the same operation as the attribute access in the HCL expression language.
Index is a helper function that performs the same operation as the index operator in the HCL expression language.
MergeBodies is like MergeFiles except it deals directly with bodies, rather than with entire files.
MergeFiles combines the given files to produce a single body that contains configuration from all of the given files.
NewDiagnosticTextWriter creates a DiagnosticWriter that writes diagnostics to the given writer as formatted text.
NewRangeScanner creates a new RangeScanner for the given buffer, producing ranges for the given filename.
NewRangeScannerFragment is like NewRangeScanner but the ranges it produces will be offset by the given starting position, which is appropriate for sub-slices of a file, whereas NewRangeScanner assumes it is scanning an entire file.
RangeBetween returns a new range that spans from the beginning of the start range to the end of the end range.
RangeOver returns a new range that covers both of the given ranges and possibly additional content between them if the two ranges do not overlap.
RelTraversalForExpr is similar to AbsTraversalForExpr but it returns a relative traversal instead.
StaticExpr returns an Expression that always evaluates to the given value.
TraversalJoin appends a relative traversal to an absolute traversal to produce a new absolute traversal.
UnwrapExpression removes any "wrapper" expressions from the given expression, to recover the representation of the physical expression given in source code.
UnwrapExpressionUntil is similar to UnwrapExpression except it gives the caller an opportunity to test each level of unwrapping to see each a particular expression is accepted.

# Constants

DiagError indicates that the problem reported by a diagnostic prevents further progress in parsing and/or evaluating the subject.
DiagInvalid is the invalid zero value of DiagnosticSeverity.
DiagWarning indicates that the problem reported by a diagnostic warrants user attention but does not prevent further progress.

# Variables

InitialPos is a suitable position to use to mark the start of a file.

# Structs

Attribute represents an attribute from within a body.
AttributeSchema represents the requirements for an attribute, and is used for matching attributes within bodies.
Block represents a nested block within a Body.
BlockHeaderSchema represents the shape of a block header, and is used for matching blocks within bodies.
BodyContent is the result of applying a BodySchema to a Body.
BodySchema represents the desired shallow structure of a body.
Diagnostic represents information to be presented to a user about an error or anomoly in parsing or evaluating configuration.
An EvalContext provides the variables and functions that should be used to evaluate an expression.
File is the top-level node that results from parsing a HCL file.
KeyValuePair represents a pair of expressions that serve as a single item within a map or object definition construct.
Pos represents a single position in a source file, by addressing the start byte of a unicode character encoded in UTF-8.
Range represents a span of characters between two positions in a source file.
RangeScanner is a helper that will scan over a buffer using a bufio.SplitFunc and visit a source range for each token matched.
StaticCall represents a function call that was extracted statically from an expression using ExprCall.
TraversalSplit represents a pair of traversals, the first of which is an absolute traversal and the second of which is relative to the first.
TraverseAttr looks up an attribute in its initial value.
TraverseIndex applies the index operation to its initial value.
TraverseRoot looks up a root name in a scope.
TraverseSplat applies the splat operation to its initial value.

# Interfaces

Body is a container for attributes and blocks.
A DiagnosticWriter emits diagnostics somehow.
Expression is a literal value or an expression provided in the configuration, which can be evaluated within a scope to produce a value.
A Traverser is a step within a Traversal.

# Type aliases

Attributes is a set of attributes keyed by their names.
Blocks is a sequence of Block.
Diagnostics is a list of Diagnostic instances.
DiagnosticSeverity represents the severity of a diagnostic.
A Traversal is a description of traversing through a value through a series of operations such as attribute lookup, index lookup, etc.