internal

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHeredoc

func CreateHeredoc(text string, heredocMarker string, escapeSequences bool) hclwrite.Tokens

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

func IndexOfWithField[T any](needle T, haystack []T, fieldName string) int

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 PluginCommandHelp(intf interface{}) (string, error)

func StringHelpPrinter

func StringHelpPrinter(output *string) kong.HelpPrinter

func ToCtyList

func ToCtyList(vals []string) cty.Value

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

func ToSnakeCase(str string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL