Documentation ¶
Overview ¶
Package computed contains types that represent the computed diffs for Terraform blocks, attributes, and outputs.
Each Diff struct is made up of a renderer, an action, and a boolean describing the diff. The renderer internally holds child diffs or concrete values that allow it to know how to render the diff appropriately.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diff ¶
type Diff struct { // Renderer captures the uncommon functionality across the different kinds // of changes. Each type of change (lists, blocks, sets, etc.) will have a // unique renderer. Renderer DiffRenderer // Action is the action described by this change (such as create, delete, // update, etc.). Action action.Action // Replace tells the Change that it should add the `# forces replacement` // suffix. // // Every single change could potentially add this suffix, so we embed it in // the change as common functionality instead of in the specific renderers. Replace bool }
Diff captures the computed diff for a single block, element or attribute.
It essentially merges common functionality across all types of changes, namely the replace logic and the action / change type. Any remaining behaviour can be offloaded to the renderer which will be unique for the various change types (eg. maps, objects, lists, blocks, primitives, etc.).
func NewDiff ¶
func NewDiff(renderer DiffRenderer, action action.Action, replace bool) Diff
NewDiff creates a new Diff object with the provided renderer, action and replace context.