Documentation ¶
Index ¶
- func AppendLineToFile(file string, l string) error
- func BuildWhitelistForStringSanitisation(wl []string) map[string]string
- func ConvertIntToStringAndAddFrontSpacing(i int64, l int) string
- func ConvertStringToFloatOrZeroOnError(s string) float64
- func ConvertStringToIntOrZeroOnError(s string) int64
- func CreateFolder(f string) error
- func DoesFileExist(p string) bool
- func DoesFolderExist(p string) bool
- func DoesStringContainsNonWhitelistedSubstrings(s string, whitelist map[string]string) bool
- func FirstCharacterToUppercase(s string) string
- func GenerateNewSHA256Sum() string
- func GenerateNewUUID() string
- func GetAllFilesInFolderByExtension(pathToFolder string, extension string) []string
- func GetAllStringKeysOfMap(in interface{}) []string
- func GetCurrentYear() int64
- func GetPathToParrentFolderOfThisExecutable() string
- func GetPathToThisExecutable() string
- func GetSHA256SumOfString(s string) string
- func GetSharedElementsOfStringSlices(a, b []string) []string
- func GetSizeOfFileInBytes(p string) (int64, error)
- func GetUniqueElementsOfStringSlices(a, b []string) []string
- func IsStringInSliceOfStrings(slice []string, target string) bool
- func IsValidEmail(s string) bool
- func IsValidURL(s string) bool
- func IsValidUUID(s string) bool
- func LoadStringFromFile(pathOfFile string) (string, error)
- func PrettyPrint(in interface{})
- func RemoveDoubledStrings(s string, target string) string
- func RemoveLeadingStrings(s string, target string) string
- func RoundFloat(f float64, p uint) float64
- func SanitizeStringWithWhitelist(s string, whitelist map[string]string) string
- func WriteStringToFile(file string, s string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendLineToFile ¶
AppendLineToFile appends the line l to file
func BuildWhitelistForStringSanitisation ¶
BuildWhitelistForStringSanitisation transfroms a slice of whitelisted substrings into a hashtable
func ConvertIntToStringAndAddFrontSpacing ¶
ConvertIntToStringAndAddFrontSpacing converts i into a string of a fixed length by adding spacing in the front
func ConvertStringToFloatOrZeroOnError ¶
ConvertStringToFloatOrZeroOnError converts s to float64, or returns 0.0 if this fails
func ConvertStringToIntOrZeroOnError ¶
ConvertStringToIntOrZeroOnError tries to convert s to an int64, or returns 0 if this fails
func DoesFileExist ¶
DoesFileExist returns true, if a file exists (and actually is a file)
func DoesFolderExist ¶
DoesFolderExist returns true, if a folder exists (and actually is a folder)
func DoesStringContainsNonWhitelistedSubstrings ¶
DoesStringContainsNonWhitelistedSubstrings returns false if s contains substrings which are not in whitelist
func FirstCharacterToUppercase ¶
FirstCharacterToUppercase converts the first character of a string to uppercase
func GenerateNewSHA256Sum ¶
func GenerateNewSHA256Sum() string
GenerateNewSHA256Sum returns a fresh SHA256Sum
func GetAllFilesInFolderByExtension ¶
GetAllFilesInFolderByExtension returns all files by extension of a given folder recursively
func GetAllStringKeysOfMap ¶
func GetAllStringKeysOfMap(in interface{}) []string
GetAllStringKeysOfMap returns all keys of a map with string keys (sorted)
func GetCurrentYear ¶
func GetCurrentYear() int64
GetCurrentYear returns the current year as YYYY int64
func GetPathToParrentFolderOfThisExecutable ¶
func GetPathToParrentFolderOfThisExecutable() string
GetPathToParrentFolderOfThisExecutable returns the path to the folder where this executable is located
func GetPathToThisExecutable ¶
func GetPathToThisExecutable() string
GetPathToThisExecutable returns the path where this executable is located
func GetSHA256SumOfString ¶
GetSHA256SumOfString returns the sha256 sum of s
func GetSharedElementsOfStringSlices ¶
GetSharedElementsOfStringSlices finds the elements that are in both slices
func GetSizeOfFileInBytes ¶
GetSizeOfFileInBytes returns the size of a file in bytes
func GetUniqueElementsOfStringSlices ¶
GetUniqueElementsOfStringSlices finds the elements that are in the first slice but not in the second slice
func IsStringInSliceOfStrings ¶
IsStringInSliceOfStrings returns true, if slice contains target
func IsValidEmail ¶
IsValidEmail returns true, if s is a email address.
func LoadStringFromFile ¶
LoadStringFromFile writes a string to a file
func RemoveDoubledStrings ¶
RemoveDoubledStrings removes all duplicate occurrences of target in s
func RemoveLeadingStrings ¶
RemoveLeadingStrings removes all leading occurrences of target in s
func SanitizeStringWithWhitelist ¶
SanitizeStringWithWhitelist cleans s by all substrings which do not occur in whitelist
func WriteStringToFile ¶
WriteStringToFile writes a string to a file
Types ¶
This section is empty.