utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorBold   = "\033[1m"
	ColorReset  = "\033[0m"
	ColorRed    = "\033[31m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorBlue   = "\033[34m"
	ColorWhite  = "\033[39m"
)

Variables

This section is empty.

Functions

func AskFor

func AskFor(message string, validValues ...string) (string, error)

func AskForInt

func AskForInt(message string) (int, error)

func ClearAfterCursor

func ClearAfterCursor()

func ClearScreen

func ClearScreen()

func DownloadFile

func DownloadFile(fileURL, targetFilePath string) error

func EditLastLine

func EditLastLine()

func Fmt

func Fmt(format string, v ...interface{}) string

func HandleError

func HandleError(err error, message string)

func LoadDataFolder

func LoadDataFolder() string

func MoveCursorTo

func MoveCursorTo(line, column int)

func MoveCursorUp

func MoveCursorUp(lineCount int)

func OnSigTerm

func OnSigTerm(callback SigCallback)

func PrintWithLoadIcon

func PrintWithLoadIcon(message string, c chan bool, stepTime time.Duration, clearScreen bool)

func WaitForEnter

func WaitForEnter(message string) error

Types

type SigCallback

type SigCallback func(sig *os.Signal)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳