Documentation ¶
Overview ¶
Package diff provides the Diff class that can be used to compare CloudFormation templates
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResourceActions ¶ added in v1.7.0
func GetResourceActions(d Diff) map[string]ActionType
Types ¶
type ActionType ¶ added in v1.7.0
type ActionType string
const ( Create ActionType = "Create" Update ActionType = "Update" Delete ActionType = "Delete" None ActionType = "None" )
type Diff ¶
type Diff interface { // Mode represents the type of change in a Diff Mode() Mode // String returns a string representation of the Diff String() string // Format returns a pretty-printed representation of the Diff // The long flag determines whether to produce long or short output Format(bool) string // Value returns the value represented by the Diff Value() interface{} }
Diff is the common interface for the other types in this package.
A Diff represents the difference (or lack of difference) between two values
func New ¶
New returns a Diff that represents the difference between two templates
Example ¶
original := map[string]interface{}{ "foo": []interface{}{ "bar", "baz", }, "quux": map[string]interface{}{ "mooz": "xyzzy", }, } fmt.Println(compareValues(original, map[string]interface{}{ "cake": "lie", }))
Output: (|)map[cake:(+)lie foo:(-)[bar baz] quux:(-)map[mooz:xyzzy]]
type Mode ¶
type Mode string
Mode represents a diff mode
const ( // Added represents a new value Added Mode = "+" // Removed represents a removed value Removed Mode = "-" // Changed represents a modified value Changed Mode = ">" // Involved represents a value that contains changes but is not wholly new itself Involved Mode = "|" // Unchanged represents a value that has not changed Unchanged Mode = "=" )
Click to show internal directories.
Click to hide internal directories.