Documentation ¶
Index ¶
- func GetKeys[K comparable, V any](m map[K]V) []K
- func IsYaml(filePath string) bool
- func MapEachSortedKeys[K constraints.Ordered, V any](m map[K]V, fu func(K, V) error) (err error)
- func NewVT10XConsole(opts ...expect.ConsoleOpt) (*expect.Console, error)
- func ResolveHomeAbs(path string) (absPath string, err error)
- func Retry(maxRetries int, retryIntervalSec, jitterLimitSec int, fu func() error) error
- func SetupDir(dirPath string) (absDirPath string, err error)
- func ToCtyValue(v interface{}) (out cty.Value, err error)
- func ToIfaceArr[T any](arr []T) []interface{}
- func ToRefArr[T any](arr []T) (refArr []*T)
- func TrimEmpty[T comparable](arr []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeys ¶
func GetKeys[K comparable, V any](m map[K]V) []K
func MapEachSortedKeys ¶
func MapEachSortedKeys[K constraints.Ordered, V any](m map[K]V, fu func(K, V) error) (err error)
func NewVT10XConsole ¶
func NewVT10XConsole(opts ...expect.ConsoleOpt) (*expect.Console, error)
NewVT10XConsole returns a new expect.Console that multiplexes the Stdin/Stdout to a VT10X terminal, allowing Console to interact with an application sending ANSI escape sequences.
func ResolveHomeAbs ¶
ResolveHomeAbs resolves home directory or relative path into absolute path
func Retry ¶
Retry executes the provided function with Retry logic. in case of failures, the `fu` is retried `maxRetries` number of time, and wait for (`retryIntervalSec` + random `jitterLimitSec`) duration between each Retry.
func SetupDir ¶
SetupDir resolves home dir (`~`) or relative path and then creates directory if missing.
func ToCtyValue ¶
func ToIfaceArr ¶
func ToIfaceArr[T any](arr []T) []interface{}
ToIfaceArr converts given T type array to interface array.
func ToRefArr ¶
func ToRefArr[T any](arr []T) (refArr []*T)
ToRefArr convert array elements to reference
func TrimEmpty ¶
func TrimEmpty[T comparable](arr []T) []T
TrimEmpty removes all empty elements from start and end of the array.
Types ¶
This section is empty.