Documentation ¶
Index ¶
- Variables
- func ConvertExpressionsHcl2HclS(in []hcl.Expression) []hclsyntax.Expression
- func PrintAdded(mr diff.Diffable, p *PrintParams)
- func PrintAttributeContext(atdf *AttributesDiff, p *PrintParams)
- func PrintModified(name string, p *PrintParams)
- func PrintRemoved(mr diff.Diffable, p *PrintParams)
- type Attribute
- type Attributes
- type AttributesDiff
- type Block
- type Blocks
- type Body
- type ChangedAttributeContext
- type ChangedExprContext
- type Expression
- type ExpressionDiff
- type Expressions
- type Item
- type Items
- type ModifiedResources
- type PrintParams
- type SortableFile
- type SortableFiles
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug bool = false
View Source
var TerraformOutput bool
Functions ¶
func ConvertExpressionsHcl2HclS ¶
func ConvertExpressionsHcl2HclS(in []hcl.Expression) []hclsyntax.Expression
func PrintAdded ¶
func PrintAdded(mr diff.Diffable, p *PrintParams)
func PrintAttributeContext ¶
func PrintAttributeContext(atdf *AttributesDiff, p *PrintParams)
func PrintModified ¶
func PrintModified(name string, p *PrintParams)
func PrintRemoved ¶
func PrintRemoved(mr diff.Diffable, p *PrintParams)
Types ¶
type Attributes ¶
type Attributes struct { Mapped hclsyntax.Attributes List []Attribute }
func NewAttributes ¶
func NewAttributes(attrs hclsyntax.Attributes) *Attributes
func (Attributes) GetDiffables ¶
func (a Attributes) GetDiffables() *[]diff.Diffable
func (Attributes) Len ¶
func (a Attributes) Len() int
func (Attributes) Less ¶
func (a Attributes) Less(i, j int) bool
func (Attributes) Swap ¶
func (a Attributes) Swap(i, j int)
type AttributesDiff ¶
type AttributesDiff struct {
Changes []ChangedAttributeContext
}
func (*AttributesDiff) Add ¶
func (atdf *AttributesDiff) Add(ctx ChangedAttributeContext)
func (*AttributesDiff) HasChanges ¶
func (atdf *AttributesDiff) HasChanges() bool
type Blocks ¶
func (Blocks) GetDiffables ¶
type ChangedAttributeContext ¶
type ChangedAttributeContext struct { //If modificationType is greater than 0 it means that attribute was added //If it is less than 0 it - attribute was removed //If it equals 0 - attribute value was changed //Unchanged attributes should not apppear in this structure ModificationType int8 Orig, Modif *Attribute Diff *ExpressionDiff }
type ChangedExprContext ¶
type ChangedExprContext struct { //If modificationType is greater than 0 it means that attribute was added //If it is less than 0 it - attribute was removed //If it equals 0 - attribute value was changed //Unchanged attributes should not apppear in this structure ModificationType int8 Orig, Modified hclsyntax.Expression OrigDiffValue, ModifDiffVal string }
type Expression ¶
type Expression struct {
Contained hclsyntax.Expression
}
func (*Expression) DiffParam ¶
func (e *Expression) DiffParam() string
func (*Expression) Range ¶
func (e *Expression) Range() hcl.Range
func (*Expression) StartRange ¶
func (e *Expression) StartRange() hcl.Range
func (*Expression) Value ¶
func (e *Expression) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics)
func (*Expression) Variables ¶
func (e *Expression) Variables() []hcl.Traversal
type ExpressionDiff ¶
type ExpressionDiff struct { Nested *ExpressionDiff Changed bool Changes []ChangedExprContext }
func (*ExpressionDiff) Add ¶
func (edf *ExpressionDiff) Add(ctx ChangedExprContext)
func (*ExpressionDiff) HasChanges ¶
func (edf *ExpressionDiff) HasChanges() bool
type Expressions ¶
type Expressions struct {
List []Expression
}
func NewHclExpressions ¶
func NewHclExpressions(expressions []hcl.Expression) *Expressions
func NewHclSyntaxExpressions ¶
func NewHclSyntaxExpressions(expressions []hclsyntax.Expression) *Expressions
func (*Expressions) Get ¶
func (e *Expressions) Get(i int) *Expression
func (*Expressions) GetDiffables ¶
func (e *Expressions) GetDiffables() *[]diff.Diffable
func (*Expressions) Len ¶
func (e *Expressions) Len() int
func (*Expressions) Less ¶
func (e *Expressions) Less(i, j int) bool
func (*Expressions) Swap ¶
func (e *Expressions) Swap(i, j int)
type Item ¶
type Item struct {
Contained hclsyntax.ObjectConsItem
}
func (*Item) Value ¶
func (i *Item) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics)
type Items ¶
type Items struct {
List []Item
}
func NewItems ¶
func NewItems(items []hclsyntax.ObjectConsItem) *Items
func (*Items) GetDiffables ¶
type ModifiedResources ¶
type ModifiedResources struct {
// contains filtered or unexported fields
}
func Compare ¶
func Compare(o, m string) (*ModifiedResources, error)
* Compare function performs comparison of 2 files, which it receives as arguments, and returns true if there are no diff o stands for original, m stands for modified It can compare terrafrom files in HCL2 format only If arguments are names of directories, it will try to perform File-by-File comparison
func CompareFiles ¶
func CompareFiles(o, m *os.File) (*ModifiedResources, error)
func NewModifiedResources ¶
func NewModifiedResources() *ModifiedResources
func (*ModifiedResources) Add ¶
func (mr *ModifiedResources) Add(s string)
func (*ModifiedResources) AddAuthor ¶
func (mr *ModifiedResources) AddAuthor(s string)
func (*ModifiedResources) IsEmpty ¶
func (mr *ModifiedResources) IsEmpty() bool
func (*ModifiedResources) List ¶
func (mr *ModifiedResources) List() *[]string
func (*ModifiedResources) ListAuthors ¶
func (mr *ModifiedResources) ListAuthors() *[]string
type PrintParams ¶
type PrintParams struct { RemoveColor *color.Color AddColor *color.Color ChangedColor *color.Color OkColor *color.Color CommentColor *color.Color LocationColor *color.Color Indent int // contains filtered or unexported fields }
func GetDefaultPrintParams ¶
func GetDefaultPrintParams() *PrintParams
func (*PrintParams) GetIndentation ¶
func (p *PrintParams) GetIndentation() string
func (*PrintParams) Shift ¶
func (p *PrintParams) Shift()
func (*PrintParams) Unshift ¶
func (p *PrintParams) Unshift()
type SortableFile ¶
func (SortableFile) DiffParam ¶
func (sf SortableFile) DiffParam() string
type SortableFiles ¶
type SortableFiles []SortableFile
func (SortableFiles) Len ¶
func (sf SortableFiles) Len() int
func (SortableFiles) Less ¶
func (sf SortableFiles) Less(i, j int) bool
func (SortableFiles) Swap ¶
func (sf SortableFiles) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.