Versions in this module Expand all Collapse all v2 v2.1.0 Nov 20, 2022 v2.0.0 Oct 26, 2022 Changes in this version + func Format(src []byte) []byte + type Attribute struct + func (a *Attribute) Expr() *Expression + func (it *Attribute) BuildTokens(to Tokens) Tokens + type Block struct + func NewBlock(typeName string, labels []string) *Block + func (b *Block) Body() *Body + func (b *Block) Labels() []string + func (b *Block) SetLabels(labels []string) + func (b *Block) SetType(typeName string) + func (b *Block) Type() string + func (it *Block) BuildTokens(to Tokens) Tokens + type Body struct + func (b *Body) AppendBlock(block *Block) *Block + func (b *Body) AppendNewBlock(typeName string, labels []string) *Block + func (b *Body) AppendNewline() + func (b *Body) AppendUnstructuredTokens(ts Tokens) + func (b *Body) Attributes() map[string]*Attribute + func (b *Body) Blocks() []*Block + func (b *Body) Clear() + func (b *Body) FirstMatchingBlock(typeName string, labels []string) *Block + func (b *Body) GetAttribute(name string) *Attribute + func (b *Body) RemoveAttribute(name string) *Attribute + func (b *Body) RemoveBlock(block *Block) bool + func (b *Body) SetAttributeRaw(name string, tokens Tokens) *Attribute + func (b *Body) SetAttributeTraversal(name string, traversal hcl.Traversal) *Attribute + func (b *Body) SetAttributeValue(name string, val cty.Value) *Attribute + func (it *Body) BuildTokens(to Tokens) Tokens + type Expression struct + func NewExpressionAbsTraversal(traversal hcl.Traversal) *Expression + func NewExpressionLiteral(val cty.Value) *Expression + func NewExpressionRaw(tokens Tokens) *Expression + func (e *Expression) RenameVariablePrefix(search, replacement []string) + func (e *Expression) Variables() []*Traversal + func (it *Expression) BuildTokens(to Tokens) Tokens + type File struct + func NewEmptyFile() *File + func NewFile() *File + func ParseConfig(src []byte, filename string, start hcl.Pos) (*File, hcl.Diagnostics) + func (f *File) Body() *Body + func (f *File) Bytes() []byte + func (f *File) WriteTo(wr io.Writer) (int64, error) + func (it *File) BuildTokens(to Tokens) Tokens + type ObjectAttrTokens struct + Name Tokens + Value Tokens + type Token struct + Bytes []byte + SpacesBefore int + Type hclsyntax.TokenType + type Tokens []*Token + func TokensForFunctionCall(funcName string, args ...Tokens) Tokens + func TokensForIdentifier(name string) Tokens + func TokensForObject(attrs []ObjectAttrTokens) Tokens + func TokensForTraversal(traversal hcl.Traversal) Tokens + func TokensForTuple(elems []Tokens) Tokens + func TokensForValue(val cty.Value) Tokens + func (ts Tokens) BuildTokens(to Tokens) Tokens + func (ts Tokens) Bytes() []byte + func (ts Tokens) Columns() int + func (ts Tokens) WriteTo(wr io.Writer) (int64, error) + type Traversal struct + func (it *Traversal) BuildTokens(to Tokens) Tokens + type TraverseIndex struct + func (it *TraverseIndex) BuildTokens(to Tokens) Tokens + type TraverseName struct + func (it *TraverseName) BuildTokens(to Tokens) Tokens