wizard

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 2 Imported by: 0

README

wizard

Project Badges

A modular, pluggable wizard orchestrator for TinyGo applications. It manages multi-step workflows with state persistence using tinywasm/context, designed for lightweight CLI and TUI integrations.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module added in v0.0.2

type Module interface {
	// Name returns the module identifier
	Name() string

	// GetSteps returns the sequence of steps this module requires.
	GetSteps() []any
}

Module represents a pluggable component that provides a sequence of steps

type Step added in v0.0.2

type Step interface {
	// Label returns the prompt text for the UI (e.g., "Project Name")
	Label() string

	// DefaultValue returns a suggestion based on the current context
	DefaultValue(ctx *context.Context) string

	// OnInput executes the step logic.
	OnInput(input string, ctx *context.Context) (newCtx *context.Context, continueFlow bool, err error)
}

Step represents a single interaction or execution unit in the wizard

type Wizard

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

Wizard orchestrates the execution of multiple Steps

func New

func New(steps []Step, onComplete func()) *Wizard

New creates a generic wizard with the given steps

func (*Wizard) AlwaysShowAllLogs added in v0.0.2

func (w *Wizard) AlwaysShowAllLogs() bool

StreamingLoggable implementation

func (*Wizard) Cancel added in v0.0.2

func (w *Wizard) Cancel()

Cancelable implementation

func (*Wizard) Change added in v0.0.2

func (w *Wizard) Change(newValue string)

func (*Wizard) Label added in v0.0.2

func (w *Wizard) Label() string

func (*Wizard) Name added in v0.0.2

func (w *Wizard) Name() string

func (*Wizard) SetLog added in v0.0.2

func (w *Wizard) SetLog(f func(message ...any))

Loggable implementation

func (*Wizard) Value added in v0.0.2

func (w *Wizard) Value() string

func (*Wizard) WaitingForUser added in v0.0.2

func (w *Wizard) WaitingForUser() bool

Jump to

Keyboard shortcuts

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