interactive

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateOrgSelect = iota
	StateProjSelect
	StateCompSelect
)

Variables

This section is empty.

Functions

func EditTextInputField

func EditTextInputField(msg tea.KeyMsg, input string, cursor int) (string, int)

func IsEnterKey

func IsEnterKey(msg tea.KeyMsg) bool

func IsQuitKey

func IsQuitKey(msg tea.KeyMsg) bool

func ProcessListCursor

func ProcessListCursor(msg tea.KeyMsg, cursor, listLength int) int

func RenderInputPrompt

func RenderInputPrompt(prompt, defaultText, currentText, errorMsg string) string

func RenderListPrompt

func RenderListPrompt(header string, items []string, cursor int) string

func RunInteractiveModel

func RunInteractiveModel(model tea.Model) (tea.Model, error)

RunInteractiveModel starts a Bubble Tea program with the given model and returns the final model state after program completion.

Types

type BaseModel

type BaseModel struct {
	Organizations            []string
	OrgCursor                int
	Projects                 []string
	ProjCursor               int
	Components               []string
	CompCursor               int
	Environments             []string
	EnvCursor                int
	DeploymentTracks         []string
	DeploymentTrackCursor    int
	DeployableArtifacts      []string
	DeployableArtifactCursor int
	ErrorMsg                 string
	State                    int
}

BaseModel holds the shared state for interactive models.

func NewBaseModel

func NewBaseModel() (*BaseModel, error)

func (*BaseModel) FetchBuildNames

func (b *BaseModel) FetchBuildNames() ([]string, error)

FetchBuildNames retrieves build names based on the current selections.

func (*BaseModel) FetchComponents

func (b *BaseModel) FetchComponents() ([]string, error)

FetchComponents retrieves component names for the currently selected organization and project.

func (*BaseModel) FetchDataPlanes

func (b *BaseModel) FetchDataPlanes() ([]string, error)

FetchDataPlanes retrieves data plane names for the currently selected organization.

func (*BaseModel) FetchDeployableArtifacts

func (b *BaseModel) FetchDeployableArtifacts() ([]string, error)

FetchDeployableArtifacts retrieves deployable artifact names based on the current selections.

func (*BaseModel) FetchDeploymentTracks

func (b *BaseModel) FetchDeploymentTracks() ([]string, error)

FetchDeploymentTracks retrieves deployment track names based on the current selections.

func (*BaseModel) FetchDeployments

func (b *BaseModel) FetchDeployments() ([]string, error)

FetchDeployments retrieves deployment names based on the current selections.

func (*BaseModel) FetchEnvironments

func (b *BaseModel) FetchEnvironments() ([]string, error)

FetchEnvironments retrieves environment names for the currently selected organization.

func (*BaseModel) FetchProjects

func (b *BaseModel) FetchProjects() ([]string, error)

FetchProjects retrieves project names for the currently selected organization.

func (BaseModel) RenderComponentSelection

func (b BaseModel) RenderComponentSelection() string

RenderComponentSelection returns a prompt for component selection.

func (BaseModel) RenderDeployableArtifactSelection

func (b BaseModel) RenderDeployableArtifactSelection() string

RenderDeployableArtifactSelection returns a prompt for deployable artifact selection.

func (BaseModel) RenderDeploymentTrackSelection

func (b BaseModel) RenderDeploymentTrackSelection() string

RenderDeploymentTrackSelection returns a prompt for deployment track selection.

func (BaseModel) RenderEnvironmentSelection

func (b BaseModel) RenderEnvironmentSelection() string

RenderEnvironmentSelection returns a prompt for environment selection.

func (BaseModel) RenderOrgSelection

func (b BaseModel) RenderOrgSelection() string

RenderOrgSelection returns a prompt for organization selection.

func (BaseModel) RenderProgress

func (b BaseModel) RenderProgress() string

RenderProgress renders the selections made so far.

func (BaseModel) RenderProjSelection

func (b BaseModel) RenderProjSelection() string

RenderProjSelection returns a prompt for project selection.

func (*BaseModel) UpdateOrgSelect

func (b *BaseModel) UpdateOrgSelect(keyMsg tea.KeyMsg) tea.Cmd

UpdateOrgSelect handles organization selection. It fetches projects when Enter is pressed.

func (*BaseModel) UpdateProjSelect

func (b *BaseModel) UpdateProjSelect(keyMsg tea.KeyMsg) (tea.Cmd, error)

UpdateProjSelect is a helper to handle project selection update. It returns a command to load components if needed.

Jump to

Keyboard shortcuts

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