util

package
v0.0.0-...-c80f5a2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(path string, content string) error

CreateFile creates / overwrites a file with content

func DownloadFile

func DownloadFile(filename string, url string) error

DownloadFile downloads a file and display status

func DownloadLib

func DownloadLib(lib Lib) error

DownloadLib download an external library

func GetLatestVersion

func GetLatestVersion() (string, error)

GetLatestVersion returns the latest version from github

func Print

func Print(str string)

Print print info

func PrintError

func PrintError(err error)

PrintError print error in red color

func PrintErrorStr

func PrintErrorStr(str string)

PrintErrorStr printed in red color

func PrintOk

func PrintOk()

PrintOk printed in green color

func PrintPretty

func PrintPretty(v interface{})

PrintPretty Pretty print of struct or slice

func PrintWarning

func PrintWarning(err error)

PrintWarning print warning in yellow color

func PrintWarningStr

func PrintWarningStr(str string)

PrintWarningStr printed in yellow color

func Println

func Println(str string)

Println print info

func QuitFatal

func QuitFatal(err error)

QuitFatal quit the app and wait for user input

func ReadLine

func ReadLine(prompt string) string

ReadLine reads input from console

func SetConsoleTitle

func SetConsoleTitle(title string) (int, error)

SetConsoleTitle sets windows console title

func URLValid

func URLValid(url string) bool

URLValid makes a GET request to a given URL and checks whether or not the resulting status code is 200.

Types

type Lib

type Lib struct {
	URL        string
	Dest       string
	OutputPath string
	Exe        string
}

Lib structure

Jump to

Keyboard shortcuts

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