precommand

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package precommand provides a bubbletea sub-model that runs a PreCommandStep with a spinner and progress display, integrating into the deploy/stage TUI as an initial phase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteMsg

type CompleteMsg struct{}

CompleteMsg indicates the pre-command step finished successfully.

type ErrorMsg

type ErrorMsg struct {
	Err error
}

ErrorMsg indicates the pre-command step failed.

type Model

type Model struct {

	// Err is set if the pre-command step failed. Check after the program exits.
	Err error
	// contains filtered or unexported fields
}

Model is a bubbletea sub-model that runs a PreCommandStep and displays progress with a spinner.

func NewModel

func NewModel(opts Options) *Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Options

type Options struct {
	Context      context.Context
	Step         Step
	ConfProvider *config.Provider
	CommandName  string
	Styles       *stylespkg.Styles
	Headless     bool
	Writer       io.Writer
}

Options for creating a new pre-command step model.

type ProgressMsg

type ProgressMsg struct {
	Phase  string
	Detail string
}

ProgressMsg represents a progress update from a Step.

type ProgressUpdateMsg

type ProgressUpdateMsg struct {
	Phase  string
	Detail string
}

ProgressUpdateMsg carries a progress update from the step to the TUI.

type Step

type Step interface {
	Run(ctx context.Context, confProvider *config.Provider, commandName string, progress chan<- ProgressMsg) error
}

Step is executed before stage/deploy engine interactions. Implementations may modify the deploy config (e.g. injecting context variables).

Jump to

Keyboard shortcuts

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