Documentation ¶
Index ¶
- Variables
- func CheckLatestVersion(currentVersion string)
- func CleanUpInterfaceMap(in map[interface{}]interface{}) map[string]interface{}
- func Cmd(conf *config.Config, program string, args ...string) error
- func CompareFileContent(filename, content string) (bool, error)
- func Confirm(msg string) bool
- func CopyDir(src string, dst string) error
- func CopyFile(src, dest string) error
- func Dedupe(l []string) []string
- func DiffMap(base, diff map[string]interface{}, conditions ...DiffCondition) map[string]interface{}
- func DownloadFile(filepath string, url string) error
- func EmptyDirectory(dir string) error
- func Error(line string, args ...interface{})
- func Exec(program string, args ...string) error
- func Execute(cmd *exec.Cmd) error
- func ExecuteWithOutput(cmd *exec.Cmd) (string, error)
- func Exists(path string) bool
- func FileExists(val interface{}) error
- func GenAESKey() string
- func GetEnvBoolValue(key string) (bool, bool)
- func GetEnvStringValue(key string) (string, bool)
- func GetKindClusterKubeconfig(name string, internal bool) (string, error)
- func Highlight(line string, args ...interface{})
- func HighlightError(err error) error
- func IsEmpty(name string) (bool, error)
- func IsKindClusterAlreadyExists(name string) bool
- func LogError() *log.Logger
- func LogInfo() *log.Logger
- func Map[T any, R SimpleType](slice []T, mapper func(elem T) R) []R
- func MapLua(tbl *lua.LTable, st interface{}) error
- func MkCmd(conf *config.Config, program string, args ...string) *exec.Cmd
- func Note(line string, args ...interface{})
- func PatchInterfaceMap(defaultValues, values map[string]map[string]interface{}) (map[string]map[string]interface{}, error)
- func Pluralize(one, many string, count int) string
- func PrintAttributes(attrs map[string]string)
- func PrintTable[T any](list []T, headers []string, rowFun func(T) ([]string, error)) error
- func ProjectRoot() (root string, found bool)
- func ReadAlphaNum(prompt string) (string, error)
- func ReadAlphaNumDefault(prompt string, def string) (string, error)
- func ReadFile(name string) (string, error)
- func ReadLine(prompt string) (string, error)
- func ReadLineDefault(prompt string, def string) (string, error)
- func ReadPwd(prompt string) (string, error)
- func RegexValidator(regex, message string) survey.Validator
- func RemoveNulls(m map[string]interface{})
- func Sha(bv []byte) string
- func Sha256(path string) (string, error)
- func Success(line string, args ...interface{})
- func Tar(src string, w io.Writer, regex string) error
- func ToGoValue(lv lua.LValue) interface{}
- func ToString(val interface{}) string
- func Untar(r io.Reader, dir, relpath string) error
- func ValidateDns(val string) error
- func ValidateRegex(val, regex, message string) error
- func ValidateSingleLevelDeep(val, subdomain string) error
- func WaitFor(timeout, interval time.Duration, f func() (bool, error)) error
- func Warn(line string, args ...interface{})
- func Which(command string) (exists bool, path string)
- func WriteFile(name string, content []byte) error
- func YamlFile(name string, out interface{}) error
- type DiffCondition
- type Mapper
- type Printer
- type SimpleType
- type Versions
Constants ¶
This section is empty.
Variables ¶
View Source
var EnableDebug bool
View Source
var ValidateAlphaNumeric = survey.ComposeValidators( survey.Required, RegexValidator("[a-z][0-9\\-a-z]+", "Must be an alphanumeric string"), )
View Source
var ValidateResourceGroupName = survey.ComposeValidators( survey.Required, RegexValidator("[a-z][a-z0-9]{2,62}", "Must be between 3 and 63 characters in length, start with lowercase letter and may contain numbers and lowercase letters only"), )
ValidateResourceGroupName validates Azure resource group names.
View Source
var ValidateStorageAccountName = survey.ComposeValidators( survey.Required, RegexValidator("[a-z][a-z0-9]{2,23}", "Must be between 3 and 24 characters in length, start with lowercase letter and may contain numbers and lowercase letters only"), )
ValidateStorageAccountName validates Azure storage account names.
Functions ¶
func CheckLatestVersion ¶
func CheckLatestVersion(currentVersion string)
func CleanUpInterfaceMap ¶
func CleanUpInterfaceMap(in map[interface{}]interface{}) map[string]interface{}
func CompareFileContent ¶
func DiffMap ¶
func DiffMap(base, diff map[string]interface{}, conditions ...DiffCondition) map[string]interface{}
DiffMap removes keys from the base map based on provided DiffCondition match against the same keys in provided diff map. It always uses an equal comparison for the values, but specific keys can use extended comparison if needed by passing custom DiffCondition function.
Example:
A: {a: 1, b: 1, c: 2} B: {a: 1, d: 2, c: 3} Result: {b: 1, c: 2}
Note: It does not remove null value keys by default.
func DownloadFile ¶
func EmptyDirectory ¶
func FileExists ¶
func FileExists(val interface{}) error
func GetEnvBoolValue ¶
func GetEnvStringValue ¶
func GetKindClusterKubeconfig ¶ added in v0.8.5
func HighlightError ¶
func IsKindClusterAlreadyExists ¶ added in v0.8.5
func Map ¶
func Map[T any, R SimpleType](slice []T, mapper func(elem T) R) []R
func PatchInterfaceMap ¶
func PrintAttributes ¶
func PrintTable ¶
func ProjectRoot ¶
func ReadAlphaNum ¶
func RegexValidator ¶
func RegexValidator(regex, message string) survey.Validator
func RemoveNulls ¶
func RemoveNulls(m map[string]interface{})
func ValidateDns ¶
func ValidateRegex ¶
func ValidateSingleLevelDeep ¶
Types ¶
type DiffCondition ¶
type Printer ¶
type Printer interface {
PrettyPrint()
}
func NewJsonPrinter ¶
func NewJsonPrinter(i interface{}) Printer
func NewYAMLPrinter ¶
func NewYAMLPrinter(i interface{}) Printer
type SimpleType ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.