Version: v11.1.2 Latest Latest

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

Go to latest
Published: Mar 4, 2022 License: GPL-3.0 Imports: 10 Imported by: 0




View Source
const (
	CyanCode = "\x1b[36m"

	ResetCode = "\x1b[0m"


View Source
var UseColor = true

UseColor determines if package will emit colors.


func Blue

func Blue(in string) string

func Bold

func Bold(in string) string

func ColorHash

func ColorHash(name string) (output string)

ColorHash Colors text using a hashing algorithm. The same text will always produce the same color while different text will produce a different color.

func ContinueTask

func ContinueTask(s string, cont, noConfirm bool) bool

ContinueTask prompts if user wants to continue task. If NoConfirm is set the action will continue without user input.

func Cyan

func Cyan(in string) string

func Error

func Error(a ...interface{})

func Errorln

func Errorln(a ...interface{})

func FormatTime

func FormatTime(i int) string

Formats a unix timestamp to ISO 8601 date (yyyy-mm-dd).

func FormatTimeQuery

func FormatTimeQuery(i int) string

Formats a unix timestamp to ISO 8601 date (Mon 02 Jan 2006 03:04:05 PM MST).

func GetInput added in v11.1.0

func GetInput(defaultValue string, noConfirm bool) (string, error)

func Green

func Green(in string) string

func Human

func Human(size int64) string

Human method returns results in human readable format.

func Info

func Info(a ...interface{})

func Infoln

func Infoln(a ...interface{})

func LessRunes

func LessRunes(iRunes, jRunes []rune) bool

LessRunes compares two rune values, and returns true if the first argument is lexicographicaly smaller.

func Magenta

func Magenta(in string) string

func OperationInfo

func OperationInfo(a ...interface{})

func OperationInfoln

func OperationInfoln(a ...interface{})

func PrintInfoValue

func PrintInfoValue(key string, values ...string)

func Red

func Red(in string) string

func SplitDBFromName

func SplitDBFromName(pkg string) (db, name string)

SplitDBFromName split apart db/package to db and package.

func SprintError

func SprintError(a ...interface{}) string

func SprintOperationInfo

func SprintOperationInfo(a ...interface{}) string

func SprintWarn

func SprintWarn(a ...interface{}) string

func Warn

func Warn(a ...interface{})

func Warnln

func Warnln(a ...interface{})


type ErrInputOverflow added in v11.1.0

type ErrInputOverflow struct{}

func (ErrInputOverflow) Error added in v11.1.0

func (e ErrInputOverflow) Error() string

Jump to

Keyboard shortcuts

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