Documentation
¶
Index ¶
- Constants
- Variables
- func ByteCountSI(b int64) string
- func DefaultWait() tea.Cmd
- func DoTick() tea.Cmd
- type CheckBox
- func (s *CheckBox[T]) EnableSelectAll()
- func (s *CheckBox[T]) GetSelected() []T
- func (s *CheckBox[T]) GetSelectedString() string
- func (s *CheckBox[T]) Select(msg tea.Msg) (*CheckBox[T], tea.Cmd, bool)
- func (s *CheckBox[T]) View() string
- func (s *CheckBox[T]) ViewTooltip(ctx context.Context)
- func (s *CheckBox[T]) ViewWithBottom(text string) string
- func (s *CheckBox[T]) WithTooltip(tooltips *[]Tooltip)
- type Clickable
- type ClickableItem
- type Downloader
- func (m *Downloader) GetCompletion() bool
- func (m *Downloader) GetError() error
- func (m *Downloader) Init() tea.Cmd
- func (m *Downloader) SetCompletion(complete bool)
- func (m *Downloader) SetError(err error)
- func (m *Downloader) Update(msg tea.Msg) (*Downloader, tea.Cmd)
- func (m *Downloader) View() string
- type EndLoading
- type ErrorLoading
- type Loading
- type NonRetryableErrorLoading
- type Selector
- type Spinner
- type TextInput
- func (ti TextInput) Update(msg tea.Msg) (TextInput, tea.Cmd, bool)
- func (ti TextInput) View() string
- func (ti TextInput) ViewErr(err error) string
- func (ti *TextInput) ViewTooltip(ctx context.Context)
- func (ti *TextInput) WithDefaultValue(value string)
- func (ti *TextInput) WithPlaceholder(placeholder string)
- func (ti *TextInput) WithPrefillValue(value string)
- func (ti *TextInput) WithTooltip(t *Tooltip)
- func (ti *TextInput) WithValidatorFn(fn func(string) error)
- type TickMsg
- type Tooltip
- type VersionSelector
Constants ¶
View Source
const ( DefaultTooltipPadding = 5 MaxTooltipWidth = 108 )
View Source
const (
ShowCursor = "\x1b[?25h"
)
Variables ¶
View Source
var Dot = Spinner{ Frames: []string{"⣾ ", "⣽ ", "⣻ ", "⢿ ", "⡿ ", "⣟ ", "⣯ ", "⣷ "}, Complete: styles.CorrectMark, FPS: time.Second / 10, }
Functions ¶
func ByteCountSI ¶
func DefaultWait ¶
Types ¶
type CheckBox ¶
type CheckBox[T any] struct { Options []T Cursor int Selected map[int]bool // Tracks selected indices ToggleTooltip bool Tooltips *[]Tooltip TooltipWidth int // contains filtered or unexported fields }
func NewCheckBox ¶
func (*CheckBox[T]) EnableSelectAll ¶
func (s *CheckBox[T]) EnableSelectAll()
func (*CheckBox[T]) GetSelected ¶
func (s *CheckBox[T]) GetSelected() []T
func (*CheckBox[T]) GetSelectedString ¶
func (*CheckBox[T]) ViewTooltip ¶
func (*CheckBox[T]) ViewWithBottom ¶
func (*CheckBox[T]) WithTooltip ¶
type Clickable ¶
type Clickable struct {
Items []*ClickableItem
}
func NewClickable ¶
func NewClickable(items ...*ClickableItem) *Clickable
func (*Clickable) ClickableUpdatePositions ¶
func (*Clickable) ClickableView ¶
func (*Clickable) PostUpdate ¶
type ClickableItem ¶
type ClickableItem struct {
// contains filtered or unexported fields
}
func NewClickableItem ¶
func NewClickableItem(displayText map[bool]string, handleFn func() error) *ClickableItem
func (*ClickableItem) UpdatePosition ¶
func (ci *ClickableItem) UpdatePosition(cleanText string) error
func (*ClickableItem) View ¶
func (ci *ClickableItem) View() string
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶
func NewDownloader(text, url, dest string, validateFn func(string) error) *Downloader
func (*Downloader) GetCompletion ¶
func (m *Downloader) GetCompletion() bool
func (*Downloader) GetError ¶
func (m *Downloader) GetError() error
func (*Downloader) Init ¶
func (m *Downloader) Init() tea.Cmd
func (*Downloader) SetCompletion ¶
func (m *Downloader) SetCompletion(complete bool)
SetCompletion allows you to manually set the completion state for testing purposes.
func (*Downloader) SetError ¶
func (m *Downloader) SetError(err error)
SetError allows you to manually set an error for testing purposes.
func (*Downloader) Update ¶
func (m *Downloader) Update(msg tea.Msg) (*Downloader, tea.Cmd)
func (*Downloader) View ¶
func (m *Downloader) View() string
type EndLoading ¶
type ErrorLoading ¶
type ErrorLoading struct {
Err error
}
type Loading ¶
type NonRetryableErrorLoading ¶
type NonRetryableErrorLoading struct {
Err error
}
type Selector ¶
type Selector[T any] struct { Options []T Cursor int CannotBack bool ToggleTooltip bool Tooltips *[]Tooltip TooltipWidth int }
func (*Selector[T]) ViewTooltip ¶
type TextInput ¶
type TextInput struct {
Text string
Cursor int // Cursor position within the text
Placeholder string
DefaultValue string
ValidationFn func(string) error
IsEntered bool
CannotBack bool
ToggleTooltip bool
Tooltip *Tooltip
TooltipWidth int
}
func NewTextInput ¶
func (*TextInput) ViewTooltip ¶
func (*TextInput) WithDefaultValue ¶
func (*TextInput) WithPlaceholder ¶
func (*TextInput) WithPrefillValue ¶
func (*TextInput) WithTooltip ¶
func (*TextInput) WithValidatorFn ¶
type Tooltip ¶
type Tooltip struct {
// contains filtered or unexported fields
}
func NewTooltip ¶
func NewTooltipSlice ¶
type VersionSelector ¶
func NewVersionSelector ¶
func NewVersionSelector(urlMap cosmosutils.BinaryVersionWithDownloadURL, currentVersion string, cannotBack bool) VersionSelector
func (*VersionSelector) View ¶
func (v *VersionSelector) View() string
Click to show internal directories.
Click to hide internal directories.