Documentation ¶
Index ¶
- Variables
- func AssignValues(command string, params map[string]string) string
- func CreateFile(file string) (*os.File, error)
- func DefaultEnv() map[string]string
- func EscapeArg(input string, doubleQuotes bool) string
- func EscapeSpecialchars(str string) string
- func ExtractParamNames(command string) []string
- func FileExists(file string) bool
- func FormatDuration(t time.Duration, defaultVal string) string
- func FormatTime(t time.Time) string
- func LogErr(action string, err error)
- func MatchExtension(file string, exts []string) bool
- func MustGetUserHomeDir() string
- func MustGetwd() string
- func MustTempDir(pattern string) string
- func Now() time.Time
- func OpenFile(file string) (*os.File, error)
- func OpenOrCreateFile(file string) (*os.File, error)
- func ParseCommand(value string) (string, error)
- func ParseTime(val string) (time.Time, error)
- func ParseVariable(value string) (string, error)
- func RemoveParams(command string) string
- func SplitCommand(cmd string, parse bool) (program string, args []string)
- func StringWithFallback(val, fallback string) string
- func StringifyParam(param Parameter) string
- func TruncString(val string, max int) string
- func UnescapeArg(input string) (string, error)
- func UnescapeSpecialchars(str string) string
- func ValidFilename(str, replacement string) string
- type Parameter
- type SyncMap
Constants ¶
This section is empty.
Variables ¶
var FixedTime time.Time
Functions ¶
func AssignValues ¶
Assign values to command parameters
func DefaultEnv ¶
DefaultEnv returns default value of environment variable.
func EscapeSpecialchars ¶
func ExtractParamNames ¶
extracts a slice of parameter names by removing the '$' from the command string.
func FormatDuration ¶
FormatDuration returns formatted duration.
func MatchExtension ¶
MatchExtension returns true if extension matches.
func MustGetUserHomeDir ¶
func MustGetUserHomeDir() string
MustGetUserHomeDir returns current working directory. Panics is os.UserHomeDir() returns error
func MustGetwd ¶
func MustGetwd() string
MustGetwd returns current working directory. Panics is os.Getwd() returns error
func OpenOrCreateFile ¶
OpenOrCreateFile opens file or creates it if it doesn't exist.
func ParseCommand ¶
ParseCommand substitutes command in the value string.
func ParseVariable ¶
ParseVariable parses variable string.
func RemoveParams ¶
Returns a command with parameters stripped from it.
func SplitCommand ¶
SplitCommand splits command string to program and arguments.
func StringWithFallback ¶
StringsWithFallback returns the first non-empty string in the parameter list.
func StringifyParam ¶
func TruncString ¶
TrunString returns truncated string.
func UnescapeArg ¶
func UnescapeSpecialchars ¶
func ValidFilename ¶
ValidFilename returns true if filename is valid.