form

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserAborted = errors.New("user aborted")

Functions

func NonEmpty

func NonEmpty(msg string) func(string) error

NonEmpty returns a validator that errors with msg if the input is empty.

func NonEmptyUUID

func NonEmptyUUID(msg string) func(string) error

func OptionalUUID

func OptionalUUID(msg string) func(string) error

func WithAccessible

func WithAccessible(accessible bool) formOption

Types

type Form

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

func NewForm

func NewForm(huhForm *huh.Form, opts ...formOption) *Form

func (*Form) Init

func (f *Form) Init() tea.Cmd

func (*Form) Run

func (f *Form) Run() error

Run runs the form only erroring from explicit error returns, not from Ctrl-C

func (*Form) RunWithContext

func (f *Form) RunWithContext(parent context.Context) error

RunWithContext runs the form using the provided context and also listens for Ctrl-C to cancel

func (*Form) Update

func (f *Form) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Form) View

func (f *Form) View() string

Jump to

Keyboard shortcuts

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