Documentation ¶
Index ¶
- func MarshalIntSchema(v any, b *Block) error
- type Block
- func (b *Block) Add(name string, v any)
- func (b *Block) AddBlock(name string) *Block
- func (b *Block) AddFuncCall(name string, funcName string, args ...any)
- func (b *Block) AddNewLine()
- func (b *Block) AddOptional(name string, v any)
- func (b *Block) AddRef(name string, id tfid.ID)
- func (b *Block) AddRefs(name string, ids []tfid.ID)
- func (b *Block) AddTFRef(name string, ref tfid.Ref)
- type Marshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalIntSchema ¶
MarshalIntSchema marshals an intschema struct using reflection.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents a Terraform block, with helpers for adding fields.
func (*Block) AddFuncCall ¶
Add a field that is always marshalled and set to the result of a TF function call.
func (*Block) AddNewLine ¶
func (b *Block) AddNewLine()
AddNewLine adds a new line to the block, it's typically used before adding nested blocks, or to separate groups of fields.
func (*Block) AddOptional ¶
Add a field to the block that is only marshaled if the value is not empty.
func (*Block) AddRef ¶
AddRef adds a tfid.ID, which may be a hardcoded slug, or a local TF ref. If the ID is empty, then no field is added.
Click to show internal directories.
Click to hide internal directories.