Documentation ¶
Index ¶
- Variables
- type BubbleProgress
- func (b *BubbleProgress) Error(err error)
- func (b *BubbleProgress) Init() tea.Cmd
- func (b *BubbleProgress) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (b *BubbleProgress) View() string
- func (b *BubbleProgress) With(fn func(ProgressControl) error) error
- func (b *BubbleProgress) Write(bytes []byte) (int, error)
- type BubbleSpinner
- type Chooser
- type InteractiveWidgets
- type Message
- type Progress
- type ProgressControl
- type Runnable
- type Spinner
- type Widgets
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotInteractive = errors.New("not interactive session")
ErrNotInteractive is returned when the user is not in an interactive session.
Functions ¶
This section is empty.
Types ¶
type BubbleProgress ¶
type BubbleProgress struct { output.InputOutput Message TotalSize int FinalPause time.Duration // contains filtered or unexported fields }
func (*BubbleProgress) Error ¶
func (b *BubbleProgress) Error(err error)
func (*BubbleProgress) Init ¶
func (b *BubbleProgress) Init() tea.Cmd
func (*BubbleProgress) View ¶
func (b *BubbleProgress) View() string
func (*BubbleProgress) With ¶
func (b *BubbleProgress) With(fn func(ProgressControl) error) error
type BubbleSpinner ¶
type BubbleSpinner struct { output.InputOutput Message // contains filtered or unexported fields }
func (*BubbleSpinner) Init ¶
func (b *BubbleSpinner) Init() tea.Cmd
func (*BubbleSpinner) View ¶
func (b *BubbleSpinner) View() string
type Chooser ¶
func NewChooser ¶
func NewChooser[T any](iw *InteractiveWidgets) Chooser[T]
NewChooser returns a new Chooser.
type InteractiveWidgets ¶
type InteractiveWidgets struct {
// contains filtered or unexported fields
}
func NewInteractiveWidgets ¶
func NewInteractiveWidgets(ctx context.Context) (*InteractiveWidgets, error)
NewInteractiveWidgets returns a set of interactive widgets if the user is in an interactive session. If the user is not in an interactive session, ErrNotInteractive error is returned.
type Message ¶
func (Message) BoundingBoxSize ¶
type Progress ¶
type Progress interface { Runnable[ProgressControl] }
type ProgressControl ¶
type Widgets ¶
type Widgets interface { // Printf prints a formatted string to the output. Printf(format string, a ...any) // NewSpinner returns a new spinner with the given message. The spinner will // be started when the With method is called and stopped when the function // returns. NewSpinner(message string) Spinner // NewProgress returns a new progress bar with the given total size and // message. The progress bar will be started when the With method is called // and stopped when the function returns. The progress bar can be updated // with the Write method. NewProgress(totalSize int, message Message) Progress }
Widgets is a set of widgets that can be used to display progress, spinners, and other interactive elements.
func NewWidgets ¶
Click to show internal directories.
Click to hide internal directories.