Documentation ¶
Index ¶
- func CreateHeredoc(text string, heredocMarker string, escapeSequences bool) hclwrite.Tokens
- func IndexOf[T comparable](needle T, haystack []T) int
- func IndexOfWithField[T any](needle T, haystack []T, fieldName string) int
- func PluginCommandHelp(intf interface{}) (string, error)
- func StringHelpPrinter(output *string) kong.HelpPrinter
- func ToCtyList(vals []string) cty.Value
- func ToSnakeCase(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHeredoc ¶
func IndexOf ¶
func IndexOf[T comparable](needle T, haystack []T) int
IndexOf takes a slice and searches through it for a given value, returning the first index where it was found, or -1 if it was not found (or if haystack is empty or nil)
func IndexOfWithField ¶
IndexOf takes a slice of structs and searches it for a given value, where the field specified in the parameters matches the field of the struct, returning the first item or -1 if it was not found (or if haystack is empty or nil, or if the key does not exist on needle)
func PluginCommandHelp ¶
func StringHelpPrinter ¶
func StringHelpPrinter(output *string) kong.HelpPrinter
func ToCtyList ¶
ToCtyList will take a slice of strings and return a cty.ListVal. If the slice is empty or nil, this returns an empty cty.ListVal
func ToSnakeCase ¶
ToSnakeCase takes a string and performs the following transformations in this order: First Pass:
- Uppercase runes are converted to their lowercase counterparts.
- Lowercase and number runes are unmodified
- Any other printable runes are converted to _
- Non printable characters are discarded
Second Pass:
- All leading and trailing _ are removed
Third (Final) Pass
- All repeating _ are reduced to 1.
Types ¶
This section is empty.