Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggerModel ¶
func NewLoggerModel(c LoggerControl) tea.Model
func NewStatusModel ¶
func NewStatusModel[T io.Closer](c *StatusControl[T]) tea.Model
func RunProgram ¶
RunProgram runs a tea.Program with a tea.Model as the initial model, which can switch itself to other model in its Update func.
Types ¶
type LoggerControl ¶
type LoggerControl struct {
// contains filtered or unexported fields
}
A LoggerControl is the user handler for a LoggerModel
func NewLoggerControl ¶
func NewLoggerControl(debug bool) LoggerControl
func (LoggerControl) Debugf ¶
func (c LoggerControl) Debugf(format string, a ...any)
Debugf appends a log entry when in debug mode
func (LoggerControl) End ¶
func (c LoggerControl) End()
End terminates the program, preserving the log entries on screen
func (LoggerControl) Infof ¶
func (c LoggerControl) Infof(format string, a ...any)
Infof appends a log entry
func (LoggerControl) Next ¶
func (c LoggerControl) Next(m tea.Model)
Next switch the current model to the next one
type LoggerModel ¶
type LoggerModel struct {
// contains filtered or unexported fields
}
A LoggerModel displays a stream of logs
func (LoggerModel) Init ¶
func (m LoggerModel) Init() tea.Cmd
func (LoggerModel) View ¶
func (m LoggerModel) View() string
type StatusControl ¶
A StatusControl is the user handler for a StausModel
func NewStatusControl ¶
func NewStatusControl[T io.Closer]() *StatusControl[T]
func (*StatusControl[T]) Monitor ¶
func (c *StatusControl[T]) Monitor(stream T) T
Monitor wraps around a read/write stream for obtaining data transfer stats
func (*StatusControl[_]) Next ¶
func (c *StatusControl[_]) Next(m tea.Model)
Next switches to the next BubbleTea Model and shut down current StatusModel
type StatusModel ¶
A StatusModel displays a updating stats of data transfer
func (StatusModel[_]) Init ¶
func (m StatusModel[_]) Init() tea.Cmd
func (StatusModel[_]) View ¶
func (m StatusModel[_]) View() string