Documentation ¶
Index ¶
- Constants
- Variables
- func Asciify(dirty string) string
- func Dir(path string) bool
- func DumpGob(filePath string, object interface{}) error
- func FetchGob(filePath string, object interface{}) error
- func FileCopy(pathFrom, pathTo string) error
- func FileExists(path string) bool
- func FileMove(pathFrom string, pathTo string) error
- func FileReadLines(path string) []string
- func FileTouch(path string) error
- func FileWildcardDelete(path string, wildcards ...string) int
- func FileWriteLines(path string, lines []string) error
- func InputConfirm(message string) bool
- func InputString(message string) string
- func IsOnline() bool
- func MapGroups(match, names []string) map[string]string
- func Mkdir(dir string) error
- func Notify(app string, appIcon string, title string, content string) error
- func PrettyPath(dir string) string
- func Proc() string
- func TrapSignal(s os.Signal, f func())
- func Wget(url, fname string) error
- func Which(command string) bool
- type StringsFlag
Constants ¶
const ( // HTTPTimeout is the default timeout used for HTTP calls HTTPTimeout = 3 // second(s) )
Variables ¶
var ( // Client is a generic HTTP Client usable widely Client = http.Client{Timeout: time.Second * HTTPTimeout} )
Functions ¶
func FileExists ¶
FileExists : return True if input string path points to a valid file
func FileReadLines ¶
FileReadLines : open, read and return slice of file lines
func FileWildcardDelete ¶
FileWildcardDelete deletes files from an array of wildcard strings
func FileWriteLines ¶
FileWriteLines : open and write slice of lines into file
func InputConfirm ¶
InputConfirm : ask for user confirmation over a given message
func InputString ¶
InputString : ask for user input over a given message
func IsOnline ¶
func IsOnline() bool
IsOnline checks internet connection coherently returning a boolean value
func PrettyPath ¶
PrettyPath replaces home directory sequence with a tilde
func TrapSignal ¶
TrapSignal provides a simple signal subscription flow
Types ¶
type StringsFlag ¶
type StringsFlag struct {
Entries []string
}
StringsFlag struct is a supported flag to wrap a list of strings
func (*StringsFlag) IsSet ¶
func (f *StringsFlag) IsSet() bool
IsSet returns true if flag has at least a value set
func (*StringsFlag) Set ¶
func (f *StringsFlag) Set(value string) error
Set sets the value of a StringsFlag object
func (*StringsFlag) String ¶
func (f *StringsFlag) String() string
String is the string representation for StringsFlag object