Documentation
¶
Overview ¶
Package updaters contains the models that wrap the variable and provide the UI for changing their values.
Index ¶
Constants ¶
View Source
const ModelID = "updater"
Variables ¶
View Source
var OnClose = CmdClose(ModelID)
OnClose defines the global command to close the program. It is set by default to CmdClose, but if running standalone, one must set it to tea.Quit, otherwise the program will not exit.
Functions ¶
func ValidateDuration ¶
Types ¶
type BoolModel ¶
type BoolModel struct {
Value *bool
}
BoolModel is a model for updating a boolean value. On startup, it sends a message to set the value to the opposite of the current value, and sends OnClose message. It has no view.
type DurationModel ¶
DurationModel is a model for updating a time.Duration value. It is a wrapper around a StringModel.
func NewDuration ¶
func NewDuration(value *time.Duration, showPrompt bool) DurationModel
func (DurationModel) Init ¶
func (m DurationModel) Init() tea.Cmd
func (DurationModel) View ¶
func (m DurationModel) View() string
type FileNewModel ¶
type FileNewModel struct {
// contains filtered or unexported fields
}
func NewFileNew ¶
func NewFileNew(v *string, placeholder string, showPrompt bool, overwrite bool) FileNewModel
func (FileNewModel) Init ¶
func (m FileNewModel) Init() tea.Cmd
func (FileNewModel) View ¶
func (m FileNewModel) View() string
type FilepickModel ¶
type FilepickModel struct {
// contains filtered or unexported fields
}
func NewFilepickModel ¶
func (FilepickModel) Init ¶
func (m FilepickModel) Init() tea.Cmd
func (FilepickModel) View ¶
func (m FilepickModel) View() string
type Model ¶
type Model[T comparable] struct { // contains filtered or unexported fields }
func NewPicklist ¶
func NewPicklist[T comparable](v *T, s *huh.Select[T]) *Model[T]
type StringModel ¶
type StringModel struct {
Value *string
// contains filtered or unexported fields
}
func NewString ¶
func NewString(ptrStr *string, placeholder string, showPrompt bool, validateFn func(s string) error) StringModel
NewString creates a new stringUpdateModel
func (StringModel) Err ¶
func (m StringModel) Err() error
func (StringModel) Init ¶
func (m StringModel) Init() tea.Cmd
func (StringModel) View ¶
func (m StringModel) View() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.