wizard

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWizard

func RunWizard(options *WizardOptions) error

RunWizard runs the wizard with the given options

Types

type Wizard

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

Wizard represents the setup wizard

func NewWizard

func NewWizard(options *WizardOptions) *Wizard

NewWizard creates a new setup wizard

func (*Wizard) Run

func (w *Wizard) Run() error

Run runs the wizard

type WizardField

type WizardField struct {
	Name        string
	Label       string
	Value       string
	Description string
	Required    bool
	Options     []string
	Validate    func(string) error
}

WizardField represents a field in a wizard step

type WizardOptions

type WizardOptions struct {
	// Interactive enables interactive mode
	Interactive bool

	// Theme sets the color theme
	Theme string

	// NoColor disables color output
	NoColor bool

	// Width sets the width of the wizard
	Width int

	// Height sets the height of the wizard
	Height int

	// ConfigPath is the path to the configuration file
	ConfigPath string

	// SkipAuth skips the authentication step
	SkipAuth bool

	// SkipDisplay skips the display settings step
	SkipDisplay bool

	// SkipNotifications skips the notification settings step
	SkipNotifications bool

	// SkipAdvanced skips the advanced settings step
	SkipAdvanced bool
}

WizardOptions contains options for the setup wizard

func DefaultWizardOptions

func DefaultWizardOptions() *WizardOptions

DefaultWizardOptions returns the default wizard options

type WizardStep

type WizardStep struct {
	Title       string
	Description string
	Fields      []WizardField
	Action      func() error
}

WizardStep represents a step in the wizard

Jump to

Keyboard shortcuts

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