Documentation ¶
Index ¶
- Constants
- Variables
- func Blue(in string) string
- func Bold(in string) string
- func ColorHash(name string) (output string)
- func Cyan(in string) string
- func FormatTime(i int) string
- func FormatTimeQuery(i int) string
- func Green(in string) string
- func Human(size int64) string
- func LessRunes(iRunes, jRunes []rune) bool
- func Magenta(in string) string
- func Red(in string) string
- func SplitDBFromName(pkg string) (db, name string)
- type ErrInputOverflow
- type Logger
- func (l *Logger) Child(name string) *Logger
- func (l *Logger) ContinueTask(s string, preset, noConfirm bool) bool
- func (l *Logger) Debugln(a ...any)
- func (l *Logger) Error(a ...any)
- func (l *Logger) Errorln(a ...any)
- func (l *Logger) GetInput(defaultValue string, noConfirm bool) (string, error)
- func (l *Logger) Info(a ...any)
- func (l *Logger) Infoln(a ...any)
- func (l *Logger) OperationInfo(a ...any)
- func (l *Logger) OperationInfoln(a ...any)
- func (l *Logger) Print(a ...any)
- func (l *Logger) Printf(format string, a ...any)
- func (l *Logger) Println(a ...any)
- func (l *Logger) SprintError(a ...any) string
- func (l *Logger) SprintOperationInfo(a ...any) string
- func (l *Logger) SprintWarn(a ...any) string
- func (l *Logger) Warn(a ...any)
- func (l *Logger) Warnln(a ...any)
Constants ¶
View Source
const ( CyanCode = "\x1b[36m" ResetCode = "\x1b[0m" )
Variables ¶
View Source
var UseColor = true
UseColor determines if package will emit colors.
Functions ¶
func ColorHash ¶
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 FormatTime ¶
Formats a unix timestamp to ISO 8601 date (yyyy-mm-dd).
func FormatTimeQuery ¶
Formats a unix timestamp to ISO 8601 date (Mon 02 Jan 2006 03:04:05 PM MST).
func LessRunes ¶
LessRunes compares two rune values, and returns true if the first argument is lexicographicaly smaller.
func SplitDBFromName ¶
SplitDBFromName split apart db/package to db and package.
Types ¶
type ErrInputOverflow ¶
type ErrInputOverflow struct{}
func (ErrInputOverflow) Error ¶
func (e ErrInputOverflow) Error() string
type Logger ¶
type Logger struct { Debug bool // contains filtered or unexported fields }
func (*Logger) ContinueTask ¶ added in v12.1.3
ContinueTask prompts if user wants to continue task. If NoConfirm is set the action will continue without user input.
func (*Logger) OperationInfo ¶
func (*Logger) OperationInfoln ¶
func (*Logger) SprintError ¶
func (*Logger) SprintOperationInfo ¶
func (*Logger) SprintWarn ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.