Documentation
¶
Index ¶
- Constants
- Variables
- func EditFile(f string) error
- func FileExists(path string) bool
- func GetOutputCommand(name string, args ...string) ([]byte, error)
- func InstalledVersion(app string) string
- func JoinIfRelative(base, file string) string
- func LaunchCommand(name string, args ...string) error
- func Now() int64
- func PrintError(e interface{})
- func PrintWarning(e interface{})
- func Question(msg string) string
- func QuestionYN(msg string, defaultResponse bool) bool
- func StrToTimestamp(date string) int64
- func TimestampToString(unix int64) string
- func Tr(msg string, vars ...interface{}) string
Constants ¶
const ( Yes = "yes" No = "no" )
Variables ¶
var ( Version string BuildTime string LocaleBaseDir string LocaleDomain string ConfigBaseDir string ConfigFile string Organization string User string Password string )
Initialized at build time
var ( Language string DefaultEditor string UserBaseDir string Config *conf.Configuration Exceptions = make(map[string]bool) )
Initialized at execution time
Functions ¶
func FileExists ¶
FilExists check if the given file or directory exists on the system.
func GetOutputCommand ¶
GetOuptutCommand returns the redirected output of a system command.
func InstalledVersion ¶
InstalledVersion returns the installed version of a package.
func JoinIfRelative ¶
JoinRelative returns the complete path of the file. - If the path of the file is absolute, it returns it. - If it is relative, it returns the absolute path from the base.
func LaunchCommand ¶
LaunchCommand launches a system command.
func PrintWarning ¶
func PrintWarning(e interface{})
PrintWarning print a yellow message in the stderr.
func Question ¶
Question displays a question to the output and returns the response given by the user.
func QuestionYN ¶
QuestionYN displays a question to the output and returns the boolean response given by the user.
func StrToTimestamp ¶
StrToTimeStamp converts a formatted string date to a timestamp.
func TimestampToString ¶
TimestampTostring convertis an UNIX timestamp to a formatted string.
Types ¶
This section is empty.