Documentation ¶
Index ¶
- Variables
- func IsValidBlockReference(name string) bool
- func IsValidType(name string) bool
- type Attribute
- type Block
- type Blocks
- type Context
- func (c *Context) Get(parts ...string) cty.Value
- func (c *Context) GetByDot(path string) cty.Value
- func (c *Context) Inner() *hcl.EvalContext
- func (c *Context) NewChild() *Context
- func (c *Context) Parent() *Context
- func (c *Context) Root() *Context
- func (c *Context) Set(val cty.Value, parts ...string)
- func (c *Context) SetByDot(val cty.Value, path string)
- type EqualityOption
- type HCLAttribute
- func (attr *HCLAttribute) AllReferences() []*Reference
- func (attr *HCLAttribute) Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (attr *HCLAttribute) Each(f func(key cty.Value, val cty.Value))
- func (attr *HCLAttribute) EndsWith(suffix interface{}) bool
- func (attr *HCLAttribute) Equals(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (attr *HCLAttribute) GreaterThan(checkValue interface{}) bool
- func (attr *HCLAttribute) GreaterThanOrEqualTo(checkValue interface{}) bool
- func (attr *HCLAttribute) HasIntersect(checkValues ...interface{}) bool
- func (attr *HCLAttribute) IsAny(options ...interface{}) bool
- func (attr *HCLAttribute) IsBool() bool
- func (attr *HCLAttribute) IsDataBlockReference() bool
- func (attr *HCLAttribute) IsEmpty() bool
- func (attr *HCLAttribute) IsFalse() bool
- func (attr *HCLAttribute) IsIterable() bool
- func (attr *HCLAttribute) IsLiteral() bool
- func (attr *HCLAttribute) IsNil() bool
- func (attr *HCLAttribute) IsNone(options ...interface{}) bool
- func (attr *HCLAttribute) IsNotAny(options ...interface{}) bool
- func (attr *HCLAttribute) IsNotEmpty() bool
- func (attr *HCLAttribute) IsNotNil() bool
- func (attr *HCLAttribute) IsNotResolvable() bool
- func (attr *HCLAttribute) IsNumber() bool
- func (attr *HCLAttribute) IsResolvable() bool
- func (attr *HCLAttribute) IsResourceBlockReference(resourceType string) bool
- func (attr *HCLAttribute) IsString() bool
- func (attr *HCLAttribute) IsTrue() bool
- func (attr *HCLAttribute) LessThan(checkValue interface{}) bool
- func (attr *HCLAttribute) LessThanOrEqualTo(checkValue interface{}) bool
- func (attr *HCLAttribute) MapValue(mapKey string) cty.Value
- func (attr *HCLAttribute) Name() string
- func (attr *HCLAttribute) NotContains(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (attr *HCLAttribute) NotEqual(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (attr *HCLAttribute) Range() Range
- func (attr *HCLAttribute) Reference() (*Reference, error)
- func (attr *HCLAttribute) ReferencesBlock(b Block) bool
- func (attr *HCLAttribute) RegexMatches(pattern interface{}) bool
- func (attr *HCLAttribute) StartsWith(prefix interface{}) bool
- func (attr *HCLAttribute) Type() cty.Type
- func (attr *HCLAttribute) Value() (ctyVal cty.Value)
- func (attr *HCLAttribute) ValueAsStrings() []string
- type HCLBlock
- func (b *HCLBlock) AllBlocks() Blocks
- func (b *HCLBlock) Attributes() map[string]Attribute
- func (b *HCLBlock) Clone(index cty.Value) Block
- func (b *HCLBlock) Context() *Context
- func (b *HCLBlock) FullName() string
- func (b *HCLBlock) GetAttribute(name string) Attribute
- func (b *HCLBlock) GetAttributes() []Attribute
- func (b *HCLBlock) GetBlock(name string) Block
- func (b *HCLBlock) GetBlocks(name string) Blocks
- func (b *HCLBlock) GetFirstMatchingBlock(names ...string) Block
- func (b *HCLBlock) GetModuleBlock() (Block, error)
- func (b *HCLBlock) GetNestedAttribute(name string) Attribute
- func (b *HCLBlock) HasBlock(childElement string) bool
- func (b *HCLBlock) HasChild(childElement string) bool
- func (b *HCLBlock) HasModuleBlock() bool
- func (b *HCLBlock) InModule() bool
- func (b *HCLBlock) InjectBlock(block Block, name string)
- func (b *HCLBlock) IsCountExpanded() bool
- func (b *HCLBlock) IsEmpty() bool
- func (b *HCLBlock) IsNil() bool
- func (b *HCLBlock) IsNotNil() bool
- func (b *HCLBlock) IsResourceType(resourceType string) bool
- func (b *HCLBlock) Label() string
- func (b *HCLBlock) Labels() []string
- func (b *HCLBlock) LocalName() string
- func (b *HCLBlock) MissingChild(childElement string) bool
- func (b *HCLBlock) MissingNestedChild(name string) bool
- func (b *HCLBlock) NameLabel() string
- func (b *HCLBlock) OverrideContext(ctx *Context)
- func (b *HCLBlock) Range() Range
- func (b *HCLBlock) ReadLines() (lines []string, comments []string, err error)
- func (b *HCLBlock) Reference() *Reference
- func (b *HCLBlock) Type() string
- func (b *HCLBlock) TypeLabel() string
- func (b *HCLBlock) UniqueName() string
- func (b *HCLBlock) Values() cty.Value
- type HCLModule
- func (c *HCLModule) GetBlocks() Blocks
- func (c *HCLModule) GetDatasByType(label string) Blocks
- func (c *HCLModule) GetProviderBlocksByProvider(providerName string, alias string) Blocks
- func (c *HCLModule) GetReferencedBlock(referringAttr Attribute) (Block, error)
- func (c *HCLModule) GetReferencingResources(originalBlock Block, referencingLabel string, referencingAttributeName string) (Blocks, error)
- func (c *HCLModule) GetResourcesByType(label string) Blocks
- type Module
- type Range
- type Reference
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeData = Type{ // contains filtered or unexported fields }
View Source
var TypeLocal = Type{ // contains filtered or unexported fields }
View Source
var TypeModule = Type{ // contains filtered or unexported fields }
View Source
var TypeOutput = Type{ // contains filtered or unexported fields }
View Source
var TypeProvider = Type{ // contains filtered or unexported fields }
View Source
var TypeResource = Type{ // contains filtered or unexported fields }
View Source
var TypeTerraform = Type{ // contains filtered or unexported fields }
View Source
var TypeVariable = Type{ // contains filtered or unexported fields }
View Source
var ValidTypes = []Type{ TypeData, TypeLocal, TypeModule, TypeOutput, TypeProvider, TypeResource, TypeTerraform, TypeVariable, }
Functions ¶
func IsValidBlockReference ¶
func IsValidType ¶
Types ¶
type Attribute ¶
type Attribute interface { IsLiteral() bool Type() cty.Type Value() cty.Value Range() Range Name() string Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool NotContains(checkValue interface{}, equalityOptions ...EqualityOption) bool HasIntersect(checkValues ...interface{}) bool StartsWith(prefix interface{}) bool EndsWith(suffix interface{}) bool Equals(checkValue interface{}, equalityOptions ...EqualityOption) bool NotEqual(checkValue interface{}, equalityOptions ...EqualityOption) bool RegexMatches(pattern interface{}) bool IsAny(options ...interface{}) bool IsNotAny(options ...interface{}) bool IsNone(options ...interface{}) bool IsTrue() bool IsFalse() bool IsEmpty() bool IsNotEmpty() bool IsNil() bool IsNotNil() bool MapValue(mapKey string) cty.Value LessThan(checkValue interface{}) bool LessThanOrEqualTo(checkValue interface{}) bool GreaterThan(checkValue interface{}) bool GreaterThanOrEqualTo(checkValue interface{}) bool IsDataBlockReference() bool Reference() (*Reference, error) AllReferences() []*Reference IsResourceBlockReference(resourceType string) bool ReferencesBlock(b Block) bool IsResolvable() bool IsNotResolvable() bool IsString() bool IsNumber() bool IsBool() bool ValueAsStrings() []string IsIterable() bool Each(f func(key cty.Value, val cty.Value)) }
type Block ¶
type Block interface { Attributes() map[string]Attribute OverrideContext(ctx *Context) HasModuleBlock() bool GetModuleBlock() (Block, error) Type() string Labels() []string Range() Range GetFirstMatchingBlock(names ...string) Block GetBlock(name string) Block AllBlocks() Blocks GetBlocks(name string) Blocks GetAttributes() []Attribute GetAttribute(name string) Attribute GetNestedAttribute(name string) Attribute Reference() *Reference LocalName() string FullName() string UniqueName() string TypeLabel() string NameLabel() string Clone(index cty.Value) Block IsCountExpanded() bool HasChild(childElement string) bool MissingChild(childElement string) bool MissingNestedChild(childElement string) bool InModule() bool Label() string HasBlock(childElement string) bool IsResourceType(resourceType string) bool IsEmpty() bool Values() cty.Value Context() *Context ReadLines() (lines []string, comments []string, err error) IsNil() bool IsNotNil() bool InjectBlock(block Block, name string) }
func NewHCLBlock ¶
type Context ¶ added in v0.58.2
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶ added in v0.58.2
type HCLAttribute ¶
type HCLAttribute struct {
// contains filtered or unexported fields
}
func NewHCLAttribute ¶
func NewHCLAttribute(attr *hcl.Attribute, ctx *Context) *HCLAttribute
func (*HCLAttribute) AllReferences ¶ added in v0.52.0
func (attr *HCLAttribute) AllReferences() []*Reference
func (*HCLAttribute) Contains ¶
func (attr *HCLAttribute) Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*HCLAttribute) Each ¶ added in v0.49.0
func (attr *HCLAttribute) Each(f func(key cty.Value, val cty.Value))
func (*HCLAttribute) EndsWith ¶
func (attr *HCLAttribute) EndsWith(suffix interface{}) bool
func (*HCLAttribute) Equals ¶
func (attr *HCLAttribute) Equals(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*HCLAttribute) GreaterThan ¶
func (attr *HCLAttribute) GreaterThan(checkValue interface{}) bool
func (*HCLAttribute) GreaterThanOrEqualTo ¶
func (attr *HCLAttribute) GreaterThanOrEqualTo(checkValue interface{}) bool
func (*HCLAttribute) HasIntersect ¶ added in v0.58.2
func (attr *HCLAttribute) HasIntersect(checkValues ...interface{}) bool
func (*HCLAttribute) IsAny ¶
func (attr *HCLAttribute) IsAny(options ...interface{}) bool
func (*HCLAttribute) IsBool ¶
func (attr *HCLAttribute) IsBool() bool
func (*HCLAttribute) IsDataBlockReference ¶
func (attr *HCLAttribute) IsDataBlockReference() bool
func (*HCLAttribute) IsEmpty ¶
func (attr *HCLAttribute) IsEmpty() bool
func (*HCLAttribute) IsFalse ¶
func (attr *HCLAttribute) IsFalse() bool
func (*HCLAttribute) IsIterable ¶ added in v0.49.0
func (attr *HCLAttribute) IsIterable() bool
func (*HCLAttribute) IsLiteral ¶
func (attr *HCLAttribute) IsLiteral() bool
func (*HCLAttribute) IsNil ¶ added in v0.53.0
func (attr *HCLAttribute) IsNil() bool
func (*HCLAttribute) IsNone ¶
func (attr *HCLAttribute) IsNone(options ...interface{}) bool
func (*HCLAttribute) IsNotAny ¶ added in v0.53.1
func (attr *HCLAttribute) IsNotAny(options ...interface{}) bool
func (*HCLAttribute) IsNotEmpty ¶ added in v0.58.5
func (attr *HCLAttribute) IsNotEmpty() bool
func (*HCLAttribute) IsNotNil ¶ added in v0.53.0
func (attr *HCLAttribute) IsNotNil() bool
func (*HCLAttribute) IsNotResolvable ¶ added in v0.58.2
func (attr *HCLAttribute) IsNotResolvable() bool
func (*HCLAttribute) IsNumber ¶
func (attr *HCLAttribute) IsNumber() bool
func (*HCLAttribute) IsResolvable ¶
func (attr *HCLAttribute) IsResolvable() bool
func (*HCLAttribute) IsResourceBlockReference ¶
func (attr *HCLAttribute) IsResourceBlockReference(resourceType string) bool
func (*HCLAttribute) IsString ¶
func (attr *HCLAttribute) IsString() bool
func (*HCLAttribute) IsTrue ¶
func (attr *HCLAttribute) IsTrue() bool
func (*HCLAttribute) LessThan ¶
func (attr *HCLAttribute) LessThan(checkValue interface{}) bool
func (*HCLAttribute) LessThanOrEqualTo ¶
func (attr *HCLAttribute) LessThanOrEqualTo(checkValue interface{}) bool
func (*HCLAttribute) Name ¶
func (attr *HCLAttribute) Name() string
func (*HCLAttribute) NotContains ¶ added in v0.54.0
func (attr *HCLAttribute) NotContains(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*HCLAttribute) NotEqual ¶ added in v0.53.0
func (attr *HCLAttribute) NotEqual(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*HCLAttribute) Range ¶
func (attr *HCLAttribute) Range() Range
func (*HCLAttribute) Reference ¶
func (attr *HCLAttribute) Reference() (*Reference, error)
func (*HCLAttribute) ReferencesBlock ¶
func (attr *HCLAttribute) ReferencesBlock(b Block) bool
func (*HCLAttribute) RegexMatches ¶
func (attr *HCLAttribute) RegexMatches(pattern interface{}) bool
func (*HCLAttribute) StartsWith ¶
func (attr *HCLAttribute) StartsWith(prefix interface{}) bool
func (*HCLAttribute) Type ¶
func (attr *HCLAttribute) Type() cty.Type
func (*HCLAttribute) Value ¶
func (attr *HCLAttribute) Value() (ctyVal cty.Value)
func (*HCLAttribute) ValueAsStrings ¶
func (attr *HCLAttribute) ValueAsStrings() []string
type HCLBlock ¶
type HCLBlock struct {
// contains filtered or unexported fields
}
func (*HCLBlock) Attributes ¶
func (*HCLBlock) GetAttribute ¶
func (*HCLBlock) GetAttributes ¶
func (*HCLBlock) GetFirstMatchingBlock ¶
func (*HCLBlock) GetModuleBlock ¶
func (*HCLBlock) GetNestedAttribute ¶
func (*HCLBlock) HasModuleBlock ¶
func (*HCLBlock) InjectBlock ¶ added in v0.58.2
func (*HCLBlock) IsCountExpanded ¶ added in v0.48.5
func (*HCLBlock) IsResourceType ¶
func (*HCLBlock) MissingChild ¶
func (*HCLBlock) MissingNestedChild ¶ added in v0.53.0
func (*HCLBlock) OverrideContext ¶ added in v0.58.2
func (*HCLBlock) UniqueName ¶ added in v0.48.5
type HCLModule ¶ added in v0.58.2
type HCLModule struct {
// contains filtered or unexported fields
}
func (*HCLModule) GetDatasByType ¶ added in v0.58.2
func (*HCLModule) GetProviderBlocksByProvider ¶ added in v0.58.2
func (*HCLModule) GetReferencedBlock ¶ added in v0.58.2
func (*HCLModule) GetReferencingResources ¶ added in v0.58.2
func (*HCLModule) GetResourcesByType ¶ added in v0.58.2
type Module ¶ added in v0.58.2
type Module interface { GetBlocks() Blocks GetResourcesByType(label string) Blocks GetDatasByType(label string) Blocks GetProviderBlocksByProvider(providerName string, alias string) Blocks GetReferencedBlock(referringAttr Attribute) (Block, error) GetReferencingResources(originalBlock Block, referencingLabel string, referencingAttributeName string) (Blocks, error) }
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
Click to show internal directories.
Click to hide internal directories.