wizard

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Value string
}

type FinishReason

type FinishReason int
const (
	FinishReasonCompleted FinishReason = iota
	FinishReasonCancelled
)

type Input

type Input struct {
	ID          string
	Placeholder string
	Type        InputType
	Limit       int
	Validator   func(string) error
	Options     []string                             // For select and toggle types
	DependsOn   string                               // ID of field this depends on
	ShowWhen    func(answers map[string]Answer) bool // Conditional visibility
}

type InputType

type InputType int
const (
	InputTypeText InputType = iota
	InputTypePassword
	InputTypeToggle
	InputTypeSelect
)

type Result

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

func (*Result) Cancelled

func (w *Result) Cancelled() bool

func (*Result) MustGetValue

func (w *Result) MustGetValue(id string) string

type State

type State struct {
	FinishReason FinishReason
}

func (*State) Cancel

func (s *State) Cancel()

func (*State) Complete

func (s *State) Complete()

type Wizard

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

func NewWizard

func NewWizard(inputs []Input) *Wizard

func (*Wizard) Run

func (w *Wizard) Run() (Result, error)

Jump to

Keyboard shortcuts

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