Documentation ¶
Index ¶
- func FindFiles(folder string, recursive, followLinks bool, patterns ...string) ([]string, error)
- func FindFilesMaxDepth(folder string, maxDepth int, followLinks bool, patterns ...string) ([]string, error)
- func FormatList(format string, args ...interface{}) collections.IGenericList
- func GetCommandFromFile(filename string, args ...interface{}) (cmd *exec.Cmd, err error)
- func GetCommandFromString(script string, args ...interface{}) (cmd *exec.Cmd, tempFile string, err error)
- func GetEnv(varName, defaultValue string) string
- func GlobFunc(args ...interface{}) []string
- func GlobFuncTrim(args ...interface{}) []string
- func IsCommand(command string) bool
- func IsShebangScript(content string) bool
- func IsTerraformFile(file string) bool
- func Lorem(kind LoremKind, params ...int) (string, error)
- func MergeDictionaries(args ...map[string]interface{}) (map[string]interface{}, error)
- func MergeLists(lists ...collections.IGenericList) collections.IGenericList
- func MustFindFiles(folder string, recursive, followLinks bool, patterns ...string) []string
- func MustFindFilesMaxDepth(folder string, maxDepth int, followLinks bool, patterns ...string) []string
- func Pwd() string
- func Relative(folder, file string) string
- func ScriptParts(content string) (program, subprogram, source string)
- func Substitute(content string, replacers ...RegexReplacer) string
- func TerraformFormat(files ...string) error
- type LoremKind
- type RegexReplacer
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFilesMaxDepth ¶
func FindFilesMaxDepth(folder string, maxDepth int, followLinks bool, patterns ...string) ([]string, error)
FindFilesMaxDepth returns the list of the files matching the array of patterns
func FormatList ¶
func FormatList(format string, args ...interface{}) collections.IGenericList
FormatList returns an array of string where format as been applied on every element of the supplied array
func GetCommandFromFile ¶
GetCommandFromFile returns an exec.Cmd structure to run the supplied script file
func GetCommandFromString ¶
func GetCommandFromString(script string, args ...interface{}) (cmd *exec.Cmd, tempFile string, err error)
GetCommandFromString returns an exec.Cmd structure to run the supplied command
func GlobFunc ¶
func GlobFunc(args ...interface{}) []string
GlobFunc returns an array of string representing the expansion of the supplied arguments using filepath.Glob function
func GlobFuncTrim ¶
func GlobFuncTrim(args ...interface{}) []string
GlobFuncTrim returns an array of string representing the expansion of the supplied arguments using filepath.Glob function, it removes the unmatched arguments
func IsCommand ¶
IsCommand ensures that the supplied command does not contain any shell specific characters
func IsShebangScript ¶
IsShebangScript determines if the supplied code has a Shebang definition #! program subprogram
func IsTerraformFile ¶
IsTerraformFile check if the file extension matches on of the terraform file extension
func MergeDictionaries ¶
MergeDictionaries merges multiple dictionaries into a single one prioritizing the first ones.
func MergeLists ¶
func MergeLists(lists ...collections.IGenericList) collections.IGenericList
MergeLists return a single list from all supplied lists
func MustFindFiles ¶
MustFindFiles returns the list of the files matching the array of patterns with panic on error
func MustFindFilesMaxDepth ¶
func MustFindFilesMaxDepth(folder string, maxDepth int, followLinks bool, patterns ...string) []string
MustFindFilesMaxDepth returns the list of the files matching the array of patterns with panic on error
func ScriptParts ¶
ScriptParts splits up the supplied content into program, subprogram and source if the content matches Shebang defintion
func Substitute ¶
func Substitute(content string, replacers ...RegexReplacer) string
Substitute actually applies the configured substituter
func TerraformFormat ¶
TerraformFormat applies terraform fmt on
Types ¶
type LoremKind ¶
type LoremKind int
LoremKind represents the various Lorem Ipsum generator type
const ( Word LoremKind Sentence Paragraph Host EMail URL )
Constant used to describe the different kind of lorem generator
func GetLoremKind ¶
GetLoremKind converts a name to LoremKind
type RegexReplacer ¶
type RegexReplacer struct {
// contains filtered or unexported fields
}
RegexReplacer defines struct composed of one regular expression and its replacement string
func InitReplacers ¶
func InitReplacers(replacers ...string) []RegexReplacer
InitReplacers configures the list of substitution that should be applied on each document