utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: GPL-2.0 Imports: 14 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 AskForConfirmation added in v0.0.2

func AskForConfirmation(message string, yesByDefault bool) bool

func AskForInt

func AskForInt(message string) (int, error)

func ClearAfterCursor

func ClearAfterCursor()

func ClearLine added in v0.0.2

func ClearLine()

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 FormatTime added in v0.0.2

func FormatTime(rawSeconds int) string

func GetUserHome added in v0.0.2

func GetUserHome() string

func HandleError

func HandleError(err error, message string)

func HideCursor added in v0.0.2

func HideCursor()

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 Pad added in v0.0.2

func Pad(n, size int) string

func PrintWithLoadIcon

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

func ShowCursor added in v0.0.2

func ShowCursor()

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