Documentation
¶
Index ¶
- Variables
- func ListOfObject[T Object](objs []T) cty.Value
- type Attribute
- type Block
- type Module
- type ModuleRef
- type NestedBlock
- func (nb *NestedBlock) AppendBlock(block *hclwrite.Block)
- func (nb *NestedBlock) EvalContext() cty.Value
- func (nb *NestedBlock) GetAttributes() map[string]*Attribute
- func (nb *NestedBlock) GetNestedBlocks() NestedBlocks
- func (nb *NestedBlock) MptfObject() cty.Value
- func (nb *NestedBlock) RemoveContent(path string)
- func (nb *NestedBlock) SetAttributeRaw(name string, tokens hclwrite.Tokens)
- func (nb *NestedBlock) String() string
- func (nb *NestedBlock) WriteBody() *hclwrite.Body
- type NestedBlocks
- type Object
- type RootBlock
- func (b *RootBlock) AppendBlock(block *hclwrite.Block)
- func (b *RootBlock) EvalContext() cty.Value
- func (b *RootBlock) GetAttributes() map[string]*Attribute
- func (b *RootBlock) GetNestedBlocks() NestedBlocks
- func (b *RootBlock) RemoveContent(path string)
- func (b *RootBlock) SetAttributeRaw(name string, tokens hclwrite.Tokens)
- func (b *RootBlock) WriteBody() *hclwrite.Body
Constants ¶
This section is empty.
Variables ¶
View Source
var RootBlockReflectionInformation = func(v map[string]cty.Value, b *RootBlock) { var moduleObj = cty.ObjectVal(map[string]cty.Value{ "key": cty.StringVal(""), "version": cty.StringVal(""), "source": cty.StringVal(""), "dir": cty.StringVal(""), "abs_dir": cty.StringVal(""), "git_hash": cty.StringVal(""), }) if b.module != nil { moduleObj = cty.ObjectVal(map[string]cty.Value{ "key": cty.StringVal(b.module.Key), "version": cty.StringVal(b.module.Version), "source": cty.StringVal(b.module.Source), "dir": cty.StringVal(b.module.Dir), "abs_dir": cty.StringVal(b.module.AbsDir), "git_hash": cty.StringVal(b.module.GitHash), }) } labels := golden.ToCtyValue(b.Labels) v["mptf"] = cty.ObjectVal(map[string]cty.Value{ "block_address": cty.StringVal(b.Address), "terraform_address": cty.StringVal(blockAddressToRef(b.Address)), "block_type": cty.StringVal(b.Type), "block_labels": labels, "module": moduleObj, "range": cty.ObjectVal(map[string]cty.Value{ "file_name": cty.StringVal(b.Range().Filename), "start_line": cty.NumberIntVal(int64(b.Range().Start.Line)), "start_column": cty.NumberIntVal(int64(b.Range().Start.Column)), "end_line": cty.NumberIntVal(int64(b.Range().End.Line)), "end_column": cty.NumberIntVal(int64(b.Range().End.Column)), }), }) }
Functions ¶
func ListOfObject ¶
Types ¶
type Attribute ¶
func NewAttribute ¶
type Module ¶
type Module struct {
Dir string
AbsDir string
ResourceBlocks []*RootBlock
DataBlocks []*RootBlock
ModuleBlocks []*RootBlock
TerraformBlocks []*RootBlock
Variables []*RootBlock
Outputs []*RootBlock
Locals []*RootBlock
MovedBlocks []*RootBlock
Key string
Source string
Version string
GitHash string
// contains filtered or unexported fields
}
func LoadModule ¶
func (*Module) RemoveBlock ¶
func (*Module) SaveToDisk ¶
type NestedBlock ¶
type NestedBlock struct {
Type string
*hclsyntax.Block
WriteBlock *hclwrite.Block
ForEach *Attribute
Iterator *Attribute
Attributes map[string]*Attribute
NestedBlocks NestedBlocks
// contains filtered or unexported fields
}
func NewNestedBlock ¶
func NewNestedBlock(rb *hclsyntax.Block, wb *hclwrite.Block) *NestedBlock
func (*NestedBlock) AppendBlock ¶
func (nb *NestedBlock) AppendBlock(block *hclwrite.Block)
func (*NestedBlock) EvalContext ¶
func (nb *NestedBlock) EvalContext() cty.Value
func (*NestedBlock) GetAttributes ¶
func (nb *NestedBlock) GetAttributes() map[string]*Attribute
func (*NestedBlock) GetNestedBlocks ¶
func (nb *NestedBlock) GetNestedBlocks() NestedBlocks
func (*NestedBlock) MptfObject ¶
func (nb *NestedBlock) MptfObject() cty.Value
func (*NestedBlock) RemoveContent ¶
func (nb *NestedBlock) RemoveContent(path string)
func (*NestedBlock) SetAttributeRaw ¶
func (nb *NestedBlock) SetAttributeRaw(name string, tokens hclwrite.Tokens)
func (*NestedBlock) String ¶
func (nb *NestedBlock) String() string
func (*NestedBlock) WriteBody ¶
func (nb *NestedBlock) WriteBody() *hclwrite.Body
type NestedBlocks ¶
type NestedBlocks map[string][]*NestedBlock
type RootBlock ¶
type RootBlock struct {
*hclsyntax.Block
WriteBlock *hclwrite.Block
Count *Attribute
ForEach *Attribute
Attributes map[string]*Attribute
NestedBlocks NestedBlocks
Type string
Labels []string
Address string
// contains filtered or unexported fields
}
func (*RootBlock) AppendBlock ¶
func (*RootBlock) EvalContext ¶
func (*RootBlock) GetAttributes ¶
func (*RootBlock) GetNestedBlocks ¶
func (b *RootBlock) GetNestedBlocks() NestedBlocks
func (*RootBlock) RemoveContent ¶
func (*RootBlock) SetAttributeRaw ¶
Click to show internal directories.
Click to hide internal directories.