Documentation
¶
Index ¶
- Constants
- Variables
- func Confirm(msg string) (bool, error)
- func Confirmf(format string, a ...any) (bool, error)
- func Error(msg string)
- func Errorf(format string, a ...any)
- func ExitProcessBar()
- func Failed(msg string)
- func Failedf(format string, a ...interface{})
- func FinishProcessBar()
- func IncProcessBar()
- func Info(msg string)
- func Infof(format string, a ...any)
- func InputPassword(msg string) (string, error)
- func IsBusy() bool
- func IsTTY() bool
- func LoadError(msg string)
- func LoadErrorf(format string, a ...any)
- func LoadFailed(msg string)
- func LoadFailedWithoutMsg()
- func LoadFailedf(format string, a ...any)
- func LoadInfo(msg string)
- func LoadInfof(format string, a ...any)
- func LoadStageSuccess(msg string)
- func LoadStageSuccessf(format string, a ...interface{})
- func LoadSuccess(msg string)
- func LoadSuccessf(format string, a ...any)
- func Print(msg string)
- func PrintTable(header []string, data [][]string)
- func PrintTableWithTitle(title string, header []string, data [][]string)
- func Printf(format string, a ...any)
- func PrintfWithoutNewline(format string, a ...any)
- func ReadLine(blocked bool) (string, error)
- func ReadLines(blocked bool) ([]string, error)
- func SetSilenceMode(silence bool)
- func SetSkipConfirmMode(skip bool)
- func SetVerboseMode(verbose bool)
- func StartLoading(msg string)
- func StartLoadingf(format string, a ...any)
- func StartOrUpdateLoading(msg string)
- func StartProcessBar(msg string)
- func StopLoading()
- func Success(msg string)
- func Successf(format string, a ...interface{})
- func UpdateLoading(msg string)
- func UpdateLoadingf(format string, a ...any)
- func UpdateProcessBar(i int)
- func Verbose(msg string)
- func Verbosef(format string, a ...any)
- func Warn(msg string)
- func Warnf(format string, a ...any)
- type Animate
- type Animater
- type BufferIO
- func (bio *BufferIO) Clear()
- func (bio *BufferIO) Close() error
- func (bio *BufferIO) Flush() error
- func (bio *BufferIO) GetBuffer() bytes.Buffer
- func (bio *BufferIO) IsTTY() bool
- func (bio *BufferIO) Open()
- func (bio *BufferIO) Read(p []byte) (n int, err error)
- func (bio *BufferIO) String() string
- func (bio *BufferIO) Writable() bool
- func (bio *BufferIO) Write(p []byte) (n int, err error)
- type FormattedText
- type IO
- func (io *IO) Confirm(msg string) (bool, error)
- func (io *IO) Confirmf(format string, a ...any) (bool, error)
- func (io *IO) Error(msg string)
- func (io *IO) Errorf(format string, a ...any)
- func (io *IO) ExitProcessBar()
- func (io *IO) Failed(msg string)
- func (io *IO) Failedf(format string, a ...any)
- func (io *IO) FinishProcessBar()
- func (io *IO) GetCurrentStream() io.Writer
- func (io *IO) GetOutputStream() io.Writer
- func (io *IO) IncProcessBar()
- func (io *IO) Info(msg string)
- func (io *IO) Infof(format string, a ...any)
- func (io *IO) InputPassword(msg string) (string, error)
- func (io *IO) IsBusy() bool
- func (io *IO) LoadError(message string)
- func (io *IO) LoadErrorf(format string, a ...interface{})
- func (io *IO) LoadFailed(message string)
- func (io *IO) LoadFailedf(format string, a ...interface{})
- func (io *IO) LoadInfo(message string)
- func (io *IO) LoadInfof(format string, a ...interface{})
- func (io *IO) LoadStageSuccess(message string)
- func (io *IO) LoadStageSuccessf(format string, a ...interface{})
- func (io *IO) LoadSuccess(message string)
- func (io *IO) LoadSuccessf(format string, a ...interface{})
- func (io *IO) LoadWarning(message string)
- func (io *IO) LoadWarningf(format string, a ...interface{})
- func (io *IO) NewSubIO() *IO
- func (io *IO) Print(msg string)
- func (io *IO) PrintTable(header []string, data [][]string)
- func (io *IO) PrintTableWithTitle(title string, header []string, data [][]string)
- func (io *IO) PrintWithoutNewline(msg string)
- func (io *IO) Printf(format string, a ...any)
- func (io *IO) PrintfWithoutNewline(format string, a ...any)
- func (io *IO) SetSilenceMode(silence bool)
- func (io *IO) SetSkipConfirmMode(skip bool)
- func (io *IO) SetVerboseMode(verbose bool)
- func (io *IO) StartLoading(message string)
- func (io *IO) StartLoadingf(format string, a ...interface{})
- func (io *IO) StartProcessBar(message string)
- func (io *IO) StopLoading()
- func (io *IO) Success(msg string)
- func (io *IO) Successf(format string, a ...interface{})
- func (io *IO) UpdateLoading(message string)
- func (io *IO) UpdateLoadingf(format string, a ...interface{})
- func (io *IO) UpdateProcessBar(i int)
- func (io *IO) Verbose(msg string)
- func (io *IO) Verbosef(format string, a ...any)
- func (io *IO) Warn(msg string)
- func (io *IO) Warnf(format string, a ...any)
- type IOer
- type LogSymbol
- type PbConfigForDag
- type ProcessBar
- type Spinner
- type SysStdin
Constants ¶
View Source
const ( RESET = "\033[0m" RED = "\033[31m" GREEN = "\033[32m" YELLOW = "\033[33m" BLUE = "\033[34m" )
Define ANSI color codes.
View Source
const ( DEBUG = log.DebugLevel NORM = log.Level(10) INFO = log.InfoLevel WARN = log.WarnLevel ERROR = log.ErrorLevel FATAL = log.FatalLevel )
Variables ¶
View Source
var ( TypeSpinner = reflect.TypeOf(&Spinner{}) TYpeProcessBar = reflect.TypeOf(&ProcessBar{}) )
View Source
var ( InfoSymbol = info("[INFO]") SuccessSymbol = success("[SUCCEED]") WarningSymbol = warn("[WARNING]") ErrorSymbol = err("[ERROR]") FailedSymbol = err("[FAILED]") )
Functions ¶
func ExitProcessBar ¶
func ExitProcessBar()
func FinishProcessBar ¶
func FinishProcessBar()
func IncProcessBar ¶
func IncProcessBar()
func InputPassword ¶
func LoadErrorf ¶
func LoadFailed ¶
func LoadFailed(msg string)
func LoadFailedWithoutMsg ¶
func LoadFailedWithoutMsg()
func LoadFailedf ¶
func LoadStageSuccess ¶
func LoadStageSuccess(msg string)
func LoadStageSuccessf ¶
func LoadStageSuccessf(format string, a ...interface{})
func LoadSuccess ¶
func LoadSuccess(msg string)
func LoadSuccessf ¶
func PrintTable ¶
func PrintTableWithTitle ¶
func PrintfWithoutNewline ¶
func SetSilenceMode ¶
func SetSilenceMode(silence bool)
func SetSkipConfirmMode ¶
func SetSkipConfirmMode(skip bool)
func SetVerboseMode ¶
func SetVerboseMode(verbose bool)
func StartLoading ¶
func StartLoading(msg string)
func StartLoadingf ¶
func StartOrUpdateLoading ¶
func StartOrUpdateLoading(msg string)
func StartProcessBar ¶
func StartProcessBar(msg string)
func StopLoading ¶
func StopLoading()
func UpdateLoading ¶
func UpdateLoading(msg string)
func UpdateLoadingf ¶
func UpdateProcessBar ¶
func UpdateProcessBar(i int)
Types ¶
type Animater ¶
type Animater interface { IsRunning() bool // contains filtered or unexported methods }
type BufferIO ¶
type BufferIO struct {
// contains filtered or unexported fields
}
BufferIO simulates an in-memory buffer that implements io.Reader, io.Writer, and io.Closer interfaces.
func NewBufferIO ¶
NewBufferIO creates a new BufferIO instance.
type FormattedText ¶
type FormattedText struct {
// contains filtered or unexported fields
}
FormattedText is a struct that holds text and its associated color.
func NewFormattedText ¶
func NewFormattedText(text, color string) *FormattedText
NewFormattedText creates a new FormattedText with the given text and color.
func (*FormattedText) Format ¶
func (ft *FormattedText) Format(istty bool) string
Format decides whether to return colored text or plain text based on istty.
func (*FormattedText) String ¶
func (ft *FormattedText) String() string
String method to comply with the Stringer interface.
type IO ¶
type IO struct {
// contains filtered or unexported fields
}
func (*IO) ExitProcessBar ¶
func (io *IO) ExitProcessBar()
func (*IO) FinishProcessBar ¶
func (io *IO) FinishProcessBar()
func (*IO) GetCurrentStream ¶
func (*IO) GetOutputStream ¶
func (*IO) IncProcessBar ¶
func (io *IO) IncProcessBar()
func (*IO) LoadErrorf ¶
func (*IO) LoadFailed ¶
func (*IO) LoadFailedf ¶
func (*IO) LoadStageSuccess ¶
func (*IO) LoadStageSuccessf ¶
func (*IO) LoadSuccess ¶
func (*IO) LoadSuccessf ¶
func (*IO) LoadWarning ¶
func (*IO) LoadWarningf ¶
func (*IO) PrintTable ¶
func (*IO) PrintTableWithTitle ¶
func (*IO) PrintWithoutNewline ¶
func (*IO) PrintfWithoutNewline ¶
func (*IO) SetSilenceMode ¶
func (*IO) SetSkipConfirmMode ¶
func (*IO) SetVerboseMode ¶
func (*IO) StartLoading ¶
func (*IO) StartLoadingf ¶
func (*IO) StartProcessBar ¶
func (*IO) StopLoading ¶
func (io *IO) StopLoading()
func (*IO) UpdateLoading ¶
func (*IO) UpdateLoadingf ¶
func (*IO) UpdateProcessBar ¶
type IOer ¶
type IOer interface { Verbose(msg string) Verbosef(format string, a ...any) Print(msg string) Printf(format string, a ...any) Info(msg string) Infof(format string, a ...any) Warn(msg string) Warnf(format string, a ...any) Error(msg string) Errorf(format string, a ...any) Confirm(msg string) (bool, error) Confirmf(format string, a ...any) (bool, error) StartLoading(message string) *IO UpdateLoading(message string) StopLoading() StartProcessBar(message string) UpdateProcessBar(message string) IncProcessBar() StopProcessBar() }
type LogSymbol ¶
type LogSymbol struct {
Symbol *FormattedText
}
type PbConfigForDag ¶
type ProcessBar ¶
type ProcessBar struct { Animate // contains filtered or unexported fields }
func (*ProcessBar) Exit ¶
func (pb *ProcessBar) Exit() error
func (*ProcessBar) Finish ¶
func (pb *ProcessBar) Finish() error
func (*ProcessBar) Increment ¶
func (pb *ProcessBar) Increment() error
func (*ProcessBar) Set ¶
func (pb *ProcessBar) Set(i int) error
func (*ProcessBar) Start ¶
func (pb *ProcessBar) Start() error
type Spinner ¶
type Spinner struct { Animate // contains filtered or unexported fields }
func (*Spinner) LoadStageSuccess ¶
Click to show internal directories.
Click to hide internal directories.