Documentation
¶
Index ¶
- func FindFiles(filePath string, recursive bool) ([]string, error)
- func GetCleanYamlBytes(input []byte) ([]byte, error)
- func HomeDir() string
- func InSlice(haystack []string, niddle string) bool
- func InfoPrint(s ...interface{}) error
- func IsDir(path string) (bool, error)
- func IsUrl(urlStr string) bool
- func IsUrlRegexp(urlStr string) bool
- func LoadYaml(path string) ([]byte, error)
- func MsgFormat(msg string, msgType MessageType, options ...string) string
- func Print(format FormatType, s ...interface{}) error
- func RewritePath(from, match string) string
- func ScanFiles(root string, exit <-chan bool, level int) (<-chan string, <-chan error)
- func StdoutError(s ...interface{}) error
- func StdoutInfo(s ...interface{}) error
- func StdoutWarn(s ...interface{}) error
- type FormatType
- type MessageType
- type StdoutStrFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCleanYamlBytes ¶
Yaml cleansing such as remove comment in yaml file.
func MsgFormat ¶
func MsgFormat(msg string, msgType MessageType, options ...string) string
Format error message
func Print ¶
func Print(format FormatType, s ...interface{}) error
Print given interface to given format
func RewritePath ¶
Rewrite given path by returning from the first occurence of given string
func ScanFiles ¶
This function provides a fast result ready machanism via feeding the result immediately as soon as the first file found. By default it will scan recursively. You can define The level of the directory if desire. Given level 0 means recursively. Level 1 is only files in given root directory. Level 2 is files in root directory + any files in folders under root. Other levels are so on and so forth. Exist channel provides a machanism for exiting the scan early without creating memory leak.
Types ¶
type FormatType ¶
type FormatType string
Print format types
const ( FormatYaml FormatType = "yaml" FormatJson FormatType = "json" FormatCmd FormatType = "cmd" )
type MessageType ¶
type MessageType string
const ( MessageTypeInfo MessageType = "info" MessageTypeWarn MessageType = "warn" MessageTypeError MessageType = "error" )
Message types
type StdoutStrFn ¶
Function type to output to stdout
func StdoutStrFactory ¶
func StdoutStrFactory(format FormatType) StdoutStrFn
stdout string conversion factory Default to json