package
1.12.0-alpha20250213
Repository: https://github.com/hashicorp/terraform.git
Documentation: pkg.go.dev
# Functions
Diagnostic formats a single diagnostic message.
No description provided by the author
DiagnosticPlain is an alternative to Diagnostic which minimises the use of virtual terminal formatting sequences.
No description provided by the author
DiagnosticWarningsCompact is an alternative to Diagnostic for when all of the given diagnostics are warnings and we want to show them compactly, with only two lines per warning and excluding all of the detail information.
DiffActionSymbol returns a string that, once passed through a colorstring.Colorize, will produce a result that can be written to a terminal to produce a symbol made of three printable characters, possibly interspersed with VT100 color codes.
HorizontalRule returns a newline character followed by a number of horizontal line characters to fill the given width.
ObjectValueID takes a value that is assumed to be an object representation of some resource instance object and attempts to heuristically find an attribute of it that is likely to be a unique identifier in the remote system that it belongs to which will be useful to the user.
ObjectValueIDOrName is a convenience wrapper around both ObjectValueID and ObjectValueName (in that preference order) to try to extract some sort of human-friendly descriptive string value for an object as additional context about an object when it is being displayed in a compact way (where not all of the attributes are visible.)
Just as with the two functions it wraps, it is a best-effort and may return two empty strings if no suitable attribute can be found for a given object.
ObjectValueName takes a value that is assumed to be an object representation of some resource instance object and attempts to heuristically find an attribute of it that is likely to be a human-friendly name in the remote system that it belongs to which will be useful to the user.
WordWrap takes a string containing unbroken lines of text and inserts newline characters to try to make the text fit within the given width.