Documentation
¶
Index ¶
- Constants
- Variables
- func ConnectFileToVerboseLogOutput(filePath string) (close func(), err error)
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func GetLevel() logrus.Level
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InteractiveSelectTea(onInputChange OnInputChange, onEnter OnEnter, onTabKey OnTabKey) (string, error)
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Job
- type LoggerWriters
- type OnEnter
- type OnInputChange
- type OnTabKey
- type ProgressReader
- type Renderer
- type Spinner
- type Step
- type StepStatus
Constants ¶
View Source
const FrameDuration = time.Millisecond * 100 // 10 frame per second
Variables ¶
View Source
var VerboseLogger = (*logrus.Logger)(nil)
View Source
var VerboseLoggerOutputs = (*LoggerWriters)(nil)
Functions ¶
func InteractiveSelectTea ¶ added in v0.0.129
func InteractiveSelectTea(onInputChange OnInputChange, onEnter OnEnter, onTabKey OnTabKey) (string, error)
--------------------------- Public API ---------------------------
Types ¶
type LoggerWriters ¶
type LoggerWriters struct {
// contains filtered or unexported fields
}
func NewLoggerOutputs ¶
func NewLoggerOutputs(logger *logrus.Logger) *LoggerWriters
func (*LoggerWriters) Add ¶
func (lw *LoggerWriters) Add(w io.Writer)
func (*LoggerWriters) Remove ¶
func (lw *LoggerWriters) Remove(w io.Writer)
func (*LoggerWriters) Set ¶
func (lw *LoggerWriters) Set()
type OnInputChange ¶ added in v0.0.129
type OnInputChange func(cursor int, filter string) (title string, options []string, newCursor int, inputErr string, hint string)
--------------------------- Callback interface (same) ---------------------------
type ProgressReader ¶ added in v0.0.86
type ProgressReader struct {
// contains filtered or unexported fields
}
func NewProgressReader ¶ added in v0.0.86
func NewProgressReader(reader io.Reader, totalSize int64, updateFunc func(percent int)) *ProgressReader
type Renderer ¶ added in v0.0.122
type Renderer struct {
IsTTY bool
// contains filtered or unexported fields
}
func NewRenderer ¶ added in v0.0.122
func NewRenderer() *Renderer
NewRenderer automatically picks TTY or log mode.
type Spinner ¶ added in v0.0.86
type Spinner struct {
// contains filtered or unexported fields
}
Spinner is a custom type that wraps a spinner with additional functionality.
func NewSpinner ¶ added in v0.0.22
NewSpinner creates a new Spinner instance with the specified message.
func (*Spinner) Start ¶ added in v0.0.86
func (sp *Spinner) Start()
Start begins the spinner animation.
func (*Spinner) Stop ¶ added in v0.0.86
func (sp *Spinner) Stop()
Stop stops the spinner animation and prints a completion message.
func (*Spinner) UpdateProgress ¶ added in v0.0.86
UpdateProgress updates the progress percentage displayed with the spinner.
type Step ¶ added in v0.0.122
type Step struct {
Name string
Status StepStatus
Current float64
Total float64
}
type StepStatus ¶ added in v0.0.122
type StepStatus string
const ( StepStatusDone StepStatus = "DONE" StepStatusFailed StepStatus = "FAILED" StepStatusRunning StepStatus = "RUNNING" StepStatusPending StepStatus = "PENDING" StepStatusWaiting StepStatus = "WAITING" )
Click to show internal directories.
Click to hide internal directories.