block

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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
}

Functions

func IsValidBlockReference

func IsValidBlockReference(name string) bool

func IsValidType

func IsValidType(name string) bool

Types

type Attribute

type Attribute interface {
	IsLiteral() bool
	Type() cty.Type
	Value() cty.Value
	Range() Range
	Name() string
	Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool
	StartsWith(prefix interface{}) bool
	EndsWith(suffix interface{}) bool
	Equals(checkValue interface{}, equalityOptions ...EqualityOption) bool
	RegexMatches(pattern interface{}) bool
	IsAny(options ...interface{}) bool
	IsNone(options ...interface{}) bool
	IsTrue() bool
	IsFalse() bool
	IsEmpty() 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)
	IsResourceBlockReference(resourceType string) bool
	ReferencesBlock(b Block) bool
	IsResolvable() bool
	IsString() bool
	IsNumber() bool
	IsBool() bool
	ValueAsStrings() []string
}

type Block

type Block interface {
	Attributes() map[string]Attribute
	AttachEvalContext(ctx *hcl.EvalContext)
	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
	TypeLabel() string
	NameLabel() string
	HasChild(childElement string) bool
	MissingChild(childElement string) bool
	InModule() bool
	Label() string
	HasBlock(childElement string) bool
	IsResourceType(resourceType string) bool
	IsEmpty() bool
	Values() cty.Value
}

func NewHCLBlock

func NewHCLBlock(hclBlock *hcl.Block, ctx *hcl.EvalContext, moduleBlock Block) Block

type Blocks

type Blocks []Block

func (Blocks) OfType

func (blocks Blocks) OfType(t string) Blocks

type EqualityOption

type EqualityOption int
const (
	IgnoreCase EqualityOption = iota
)

type HCLAttribute

type HCLAttribute struct {
	// contains filtered or unexported fields
}

func NewHCLAttribute

func NewHCLAttribute(attr *hcl.Attribute, ctx *hcl.EvalContext) *HCLAttribute

func (*HCLAttribute) Contains

func (attr *HCLAttribute) Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool

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) 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) IsLiteral

func (attr *HCLAttribute) IsLiteral() bool

func (*HCLAttribute) IsNone

func (attr *HCLAttribute) IsNone(options ...interface{}) 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) MapValue

func (attr *HCLAttribute) MapValue(mapKey string) cty.Value

func (*HCLAttribute) Name

func (attr *HCLAttribute) Name() string

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) AllBlocks

func (block *HCLBlock) AllBlocks() Blocks

func (*HCLBlock) AttachEvalContext

func (block *HCLBlock) AttachEvalContext(ctx *hcl.EvalContext)

func (*HCLBlock) Attributes

func (block *HCLBlock) Attributes() map[string]Attribute

func (*HCLBlock) FullName

func (block *HCLBlock) FullName() string

func (*HCLBlock) GetAttribute

func (block *HCLBlock) GetAttribute(name string) Attribute

func (*HCLBlock) GetAttributes

func (block *HCLBlock) GetAttributes() []Attribute

func (*HCLBlock) GetBlock

func (block *HCLBlock) GetBlock(name string) Block

func (*HCLBlock) GetBlocks

func (block *HCLBlock) GetBlocks(name string) Blocks

func (*HCLBlock) GetFirstMatchingBlock

func (block *HCLBlock) GetFirstMatchingBlock(names ...string) Block

func (*HCLBlock) GetModuleBlock

func (block *HCLBlock) GetModuleBlock() (Block, error)

func (*HCLBlock) GetNestedAttribute

func (block *HCLBlock) GetNestedAttribute(name string) Attribute

func (*HCLBlock) HasBlock

func (block *HCLBlock) HasBlock(childElement string) bool

func (*HCLBlock) HasChild

func (block *HCLBlock) HasChild(childElement string) bool

func (*HCLBlock) HasModuleBlock

func (block *HCLBlock) HasModuleBlock() bool

func (*HCLBlock) InModule

func (block *HCLBlock) InModule() bool

func (*HCLBlock) IsEmpty

func (block *HCLBlock) IsEmpty() bool

func (*HCLBlock) IsResourceType

func (block *HCLBlock) IsResourceType(resourceType string) bool

func (*HCLBlock) Label

func (block *HCLBlock) Label() string

func (*HCLBlock) Labels

func (block *HCLBlock) Labels() []string

func (*HCLBlock) LocalName

func (block *HCLBlock) LocalName() string

LocalName is the name relative to the current module

func (*HCLBlock) MissingChild

func (block *HCLBlock) MissingChild(childElement string) bool

func (*HCLBlock) NameLabel

func (block *HCLBlock) NameLabel() string

func (*HCLBlock) Range

func (block *HCLBlock) Range() Range

func (*HCLBlock) Reference

func (block *HCLBlock) Reference() *Reference

func (*HCLBlock) Type

func (block *HCLBlock) Type() string

func (*HCLBlock) TypeLabel

func (block *HCLBlock) TypeLabel() string

func (*HCLBlock) Values

func (block *HCLBlock) Values() cty.Value

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

func (Range) String

func (r Range) String() string

String creates a human-readable summary of the range

type Reference

type Reference struct {
	// contains filtered or unexported fields
}

func (*Reference) BlockType

func (r *Reference) BlockType() Type

func (*Reference) NameLabel

func (r *Reference) NameLabel() string

func (*Reference) RefersTo

func (r *Reference) RefersTo(b Block) bool

func (*Reference) String

func (r *Reference) String() string

func (*Reference) TypeLabel

func (r *Reference) TypeLabel() string

type Type

type Type struct {
	// contains filtered or unexported fields
}

func TypeFromRefName

func TypeFromRefName(name string) (*Type, error)

func (Type) Name

func (t Type) Name() string

func (Type) ShortName

func (t Type) ShortName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL