Documentation ¶
Index ¶
- Variables
- func Color(attributes ...string) (*color.Color, error)
- func ColorErrorPrint(args ...interface{}) (int, error)
- func ColorErrorPrintf(format string, args ...interface{}) (int, error)
- func ColorErrorPrintln(args ...interface{}) (int, error)
- func ColorPrint(args ...interface{}) (int, error)
- func ColorPrintf(format string, args ...interface{}) (int, error)
- func ColorPrintln(args ...interface{}) (int, error)
- 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 FormatMessage(args ...interface{}) string
- 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 GetRegexGroup(key string, definitions []string) (result []*regexp.Regexp, err error)
- 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 MultiMatch(s string, expressions ...*regexp.Regexp) (map[string]string, int)
- 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 SprintColor(args ...interface{}) (string, error)
- func Substitute(content string, replacers ...RegexReplacer) string
- func TerraformFormat(files ...string) error
- type Attribute
- type LoremKind
- type RegexReplacer
- type String
Constants ¶
This section is empty.
Variables ¶
var EOL = fmt.Sprintln()
Functions ¶
func ColorErrorPrint ¶
ColorErrorPrint call standard fmt.Printf function but using the color out stream.
func ColorErrorPrintf ¶
ColorErrorPrintf call standard fmt.Printf function but using the color out stream.
func ColorErrorPrintln ¶
ColorErrorPrintln call standard fmt.Println function but using the color out stream.
func ColorPrint ¶
ColorPrint call standard fmt.Printf function but using the color out stream.
func ColorPrintf ¶
ColorPrintf call standard fmt.Printf function but using the color out stream.
func ColorPrintln ¶
ColorPrintln call standard fmt.Println function but using the color out stream.
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 FormatMessage ¶
func FormatMessage(args ...interface{}) string
FormatMessage analyses the arguments to determine if printf or println should be used.
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 GetRegexGroup ¶
GetRegexGroup cache compiled regex to avoid multiple interpretation of the same regex
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 MultiMatch ¶
MultiMatch returns a map of matching elements from a list of regular expressions (returning the first matching element)
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 SprintColor ¶
SprintColor returns a string formated with attributes that are supplied before
func Substitute ¶
func Substitute(content string, replacers ...RegexReplacer) string
Substitute actually applies the configured substituter
func TerraformFormat ¶
TerraformFormat applies terraform fmt on
Types ¶
type Attribute ¶
Attribute is imported from color attribute
const ( Reset Attribute = iota Bold Faint Italic Underline BlinkSlow BlinkRapid ReverseVideo Concealed CrossedOut )
The following constant are copied from the color package in order to get the actual names
Foreground attributes
const ( FgHiBlack Attribute = iota + 90 FgHiRed FgHiGreen FgHiYellow FgHiBlue FgHiMagenta FgHiCyan FgHiWhite )
Foreground attributes high intensity
Background attributes
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