system

package
v0.0.0-...-f539960 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTPTimeout is the default timeout used for HTTP calls
	HTTPTimeout = 3 // second(s)
)

Variables

View Source
var (
	// Client is a generic HTTP Client usable widely
	Client = http.Client{Timeout: time.Second * HTTPTimeout}
)

Functions

func Asciify

func Asciify(dirty string) string

Asciify : transform eventually unicoded string to ASCII

func Dir

func Dir(path string) bool

Dir : return True if input string path is a directory

func DumpGob

func DumpGob(filePath string, object interface{}) error

DumpGob : serialize and dump to disk given object to give filePath path

func FetchGob

func FetchGob(filePath string, object interface{}) error

FetchGob : load previously dumped object from filePath to given object

func FileCopy

func FileCopy(pathFrom, pathTo string) error

FileCopy : copy file from input string pathFrom to input string pathTo

func FileExists

func FileExists(path string) bool

FileExists : return True if input string path points to a valid file

func FileMove

func FileMove(pathFrom string, pathTo string) error

FileMove : move file from input string pathFrom to input string pathTo

func FileReadLines

func FileReadLines(path string) []string

FileReadLines : open, read and return slice of file lines

func FileTouch

func FileTouch(path string) error

FileTouch : create file in input string path

func FileWildcardDelete

func FileWildcardDelete(path string, wildcards ...string) int

FileWildcardDelete deletes files from an array of wildcard strings

func FileWriteLines

func FileWriteLines(path string, lines []string) error

FileWriteLines : open and write slice of lines into file

func InputConfirm

func InputConfirm(message string) bool

InputConfirm : ask for user confirmation over a given message

func InputString

func InputString(message string) string

InputString : ask for user input over a given message

func IsOnline

func IsOnline() bool

IsOnline checks internet connection coherently returning a boolean value

func MapGroups

func MapGroups(match, names []string) map[string]string

MapGroups returns a mapping between regex SubexpNames and match

func Mkdir

func Mkdir(dir string) error

Mkdir : create directory dir if not already existing

func Notify

func Notify(app string, appIcon string, title string, content string) error

Notify provides a simple function interface to the notification firing logic

func PrettyPath

func PrettyPath(dir string) string

PrettyPath replaces home directory sequence with a tilde

func Proc

func Proc() string

Proc returns process path

func TrapSignal

func TrapSignal(s os.Signal, f func())

TrapSignal provides a simple signal subscription flow

func Wget

func Wget(url, fname string) error

Wget performs a GET over a given asset URL writing it on a give filename

func Which

func Which(command string) bool

Which returns true if command is found, false otherwise

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL