spinner

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoneMsg

type DoneMsg struct {
	Result interface{}
}

type ErrorMsg

type ErrorMsg struct {
	Err error
}

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents an interactive spinner with state.

func NewSpinnerModel

func NewSpinnerModel() Model

NewSpinnerModel creates a default spinner model.

func NewSpinnerModelWithMessage

func NewSpinnerModelWithMessage(message string) Model

NewSpinnerModelWithMessage creates a spinner model with a custom initial message.

func (Model) GetError

func (m Model) GetError() error

GetError returns the spinner error.

func (Model) GetResult

func (m Model) GetResult() interface{}

GetResult returns the spinner result.

func (Model) HasError

func (m Model) HasError() bool

HasError checks if the spinner has an error.

func (Model) HasResult

func (m Model) HasResult() bool

HasResult checks if the spinner has a result.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the spinner model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles spinner state updates.

func (Model) View

func (m Model) View() string

View renders the spinner model.

type ProgressMsg

type ProgressMsg struct {
	Value int
	Max   int
}

type ResultMsg

type ResultMsg struct {
	Result interface{}
}

Message types for spinner communication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL