Documentation ¶
Index ¶
- Variables
- func ColorizedPrettyPrint(data any)
- func ContainsNonNumeric(s string) bool
- func DoesExist(path string) bool
- func FileExists(path string) bool
- func GetAbsPath(path string) string
- func GetCodeUntilMatchingBrace(input string) string
- func GetDirName(path string) string
- func GetFileContentAsBytes(path string) ([]byte, error)
- func GetFileName(path string) string
- func GetFirstKeyInMap(m map[string]interface{}) string
- func GetInput(message string) string
- func IsDir(p string) bool
- func IsHiddenObject(path string) bool
- func IsHiddenPath(path string) bool
- func IsInitialized(dir string) bool
- func IsItemInSlice(item string, items []string) bool
- func MustUnquote(str string) string
- func PrettyPrintStruct(i interface{})
- func PrintCharacterXTimes(char string, times int)
- func RemoveLastDot(s string) string
- func StreamToByte(stream io.Reader) []byte
- func StripProviderPrefix(provider string) string
Constants ¶
This section is empty.
Variables ¶
var Marshal = func(v interface{}) (io.Reader, error) { b, err := json.MarshalIndent(v, "", "\t") if err != nil { return nil, err } return bytes.NewReader(b), nil }
var Unmarshal = func(r io.Reader, v interface{}) error { return json.NewDecoder(r).Decode(v) }
Functions ¶
func ColorizedPrettyPrint ¶
func ColorizedPrettyPrint(data any)
func ContainsNonNumeric ¶
ContainsNonNumeric
@brief:
ContainsNonNumeric check if there are non-numeric chars inside a given string
@params:
s - string - the string to check
@returns:
bool - true if contains chars, otherwise false
func FileExists ¶
FileExists
@brief:
FileExists checks if a file exists
@params:
path - string - the path to check
@returns:
bool - true if exists, otherwise false
func GetAbsPath ¶
GetAbsPath
@brief:
GetAbsPath finds the absolute path of an object
@params:
path - string - the path to fins abs of
@returns:
string - the absolute path
func GetCodeUntilMatchingBrace ¶
GetCodeUntilMatchingBrace
@brief:
GetCodeUntilMatchingBrace returns the code until the next matching bracket
@params:
input string - the code as string to work on
@returns:
string - string with matching sets of brackets
func GetDirName ¶
GetDirName
@brief:
GetDirName returns a file dir out of a given path
@params:
path - string - the path to get the dir path from
@returns:
string - the dir path
func GetFileContentAsBytes ¶
func GetFileName ¶
GetFileName
@brief:
GetFileName returns a file name out of a given path
@params:
path - string - the path to get the file name from
@returns:
string - the file name
func GetFirstKeyInMap ¶
GetFirstKeyInMap
@brief:
GetFirstKeyInMap finds the first key in a map[string]interface{} object
@params:
m map[string]interface{} - the map to go over
@returns:
string - the first key, or "" if empty
func GetInput ¶
GetInput
@brief: GetInput will gets input from user and returns it @ @params: message string - the message to print to the user @ @returns: string - the input from the user
func IsHiddenObject ¶
IsHiddenObject
@brief:
IsHiddenObject checks if a given folder / file is hidden
@params:
path - string - the path to check
@returns:
bool - true if hidden, otherwise false
func IsHiddenPath ¶
IsHiddenPath
@brief:
IsHiddenPath checks if a given path is hidden
@params:
path - string - the path to check
@returns:
bool - true if hidden, otherwise false
func IsInitialized ¶
func IsItemInSlice ¶
IsItemInSlice
@brief:
IsItemInSlice checks if a given item is inside a given slice
@params:
item - string - the item to look for items - []string - the slice to look in
@returns:
bool - true if exists else false
func MustUnquote ¶
MustUnquote
@brief: MustUnquote get string input and returns it unquoted @ @params: str string - the string to unquote @ @returns: string - the new string
func PrettyPrintStruct ¶
func PrettyPrintStruct(i interface{})
func PrintCharacterXTimes ¶
PrintCharacterXTimes
@brief:
PrintCharacterXTimes prints a character a specified amount of time
@params:
char - string - the char to print times - int - how many times to print
func RemoveLastDot ¶
RemoveLastDot
@brief:
RemoveLastDot removed the last dot form a sentence
@params:
s - string - the removed dot sentence
func StreamToByte ¶
func StripProviderPrefix ¶
StripProviderPrefix
@brief:
StripProviderPrefix cleans the provider name from its registry prefix
@params:
provider - string - the provider to strip
@returns:
string - the stripped provide
Types ¶
This section is empty.