steps

package
v1.2.5-alpha-1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INCOMPLETE = iota
	COMPLETE
	FAILED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteStepMsg

type CompleteStepMsg struct {
	Err error
}

type Entry

type Entry struct {
	Text   string
	Status int
	Err    error
}

func NewStep

func NewStep(text string) Entry

type Model

type Model struct {
	Steps []Entry
	// contains filtered or unexported fields
}

func New

func New() Model

func (Model) CompleteStepCmd

func (m Model) CompleteStepCmd(err error) tea.Cmd

CompleteStepCmd set the current step as completed

func (Model) Init

func (m Model) Init() tea.Cmd

Init returns an initial command for the application to run

func (Model) SignalAllStepCompletedCmd

func (m Model) SignalAllStepCompletedCmd() tea.Cmd

SignalAllStepCompletedCmd signals the finish of all steps

func (Model) SignalStepCompletedCmd

func (m Model) SignalStepCompletedCmd(index int) tea.Cmd

SignalStepCompletedCmd signals the finish of a step This is useful for when you want to trigger a certain action when a certain step finishes

func (Model) SignalStepErrorCmd

func (m Model) SignalStepErrorCmd(index int, err error) tea.Cmd

SignalStepErrorCmd signals the finish of a step with an error This is useful for when you want to trigger a certain action when a certain step finishes with an error

func (Model) SignalStepStartedCmd

func (m Model) SignalStepStartedCmd(index int) tea.Cmd

SignalStepStartedCmd signals the start of a step This is useful for when you want to trigger a certain action when a certain step starts

func (Model) StartCmd

func (m Model) StartCmd() tea.Cmd

StartCmd starts the step component

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update handles incoming events and updates the model accordingly

func (Model) View

func (m Model) View() string

View renders the UI based on the data in the model

type SignalAllStepCompletedMsg

type SignalAllStepCompletedMsg struct{}

type SignalStepCompletedMsg

type SignalStepCompletedMsg struct {
	Index int
}

type SignalStepErrorMsg

type SignalStepErrorMsg struct {
	Index int
	Err   error
}

type SignalStepStartedMsg

type SignalStepStartedMsg struct {
	Index int
}

type StartMsg

type StartMsg struct{}

Jump to

Keyboard shortcuts

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