Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package tui provides the terminal user interface for Prism.

This package implements a full-featured TUI using the BubbleTea framework, providing an interactive alternative to the command-line interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App represents the TUI application

func NewApp

func NewApp() *App

NewApp creates a new TUI application

func (*App) Run

func (a *App) Run() error

Run starts the TUI application

type AppMessageDispatcher

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

AppMessageDispatcher manages app message handlers (Command Pattern - SOLID)

func NewAppMessageDispatcher

func NewAppMessageDispatcher() *AppMessageDispatcher

NewAppMessageDispatcher creates app message dispatcher

func (*AppMessageDispatcher) Dispatch

func (d *AppMessageDispatcher) Dispatch(m AppModel, msg tea.Msg) (AppModel, tea.Cmd)

Dispatch processes message using appropriate handler

type AppMessageHandler

type AppMessageHandler interface {
	CanHandle(msg tea.Msg) bool
	Handle(m AppModel, msg tea.Msg) (AppModel, []tea.Cmd)
}

AppMessageHandler interface for handling different app messages (Command Pattern - SOLID)

type AppModel

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

AppModel represents the main application model

func (AppModel) Init

func (m AppModel) Init() tea.Cmd

Init initializes the application model

func (AppModel) Update

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

Update handles messages using Command Pattern (SOLID: Single Responsibility)

func (AppModel) View

func (m AppModel) View() string

View renders the application

type PageID

type PageID int

PageID represents different pages in the TUI

const (
	// DashboardPage shows the main dashboard
	DashboardPage PageID = iota
	// InstancesPage shows instance management
	InstancesPage
	// TemplatesPage shows template selection
	TemplatesPage
	// StoragePage shows storage management
	StoragePage
	// ProjectsPage shows project management (Phase 4 Enterprise)
	ProjectsPage
	// BudgetPage shows budget management (Phase 4 Enterprise)
	BudgetPage
	// UsersPage shows user management (Phase 5A.2)
	UsersPage
	// PolicyPage shows policy framework management (Phase 5A+)
	PolicyPage
	// MarketplacePage shows template marketplace (Phase 5B)
	MarketplacePage
	// IdlePage shows idle detection and hibernation management (Phase 3)
	IdlePage
	// AMIPage shows AMI management
	AMIPage
	// RightsizingPage shows rightsizing recommendations
	RightsizingPage
	// LogsPage shows logs viewer
	LogsPage
	// DaemonPage shows daemon management
	DaemonPage
	// SettingsPage shows application settings
	SettingsPage
	// ProfilesPage shows profile management
	ProfilesPage
)

type PageModelUpdater

type PageModelUpdater struct{}

PageModelUpdater handles updating the current page model

func (*PageModelUpdater) UpdateCurrentPage

func (u *PageModelUpdater) UpdateCurrentPage(m AppModel, msg tea.Msg) (AppModel, tea.Cmd)
type PageNavigationHandler struct{}

PageNavigationHandler handles page navigation keys

func (h *PageNavigationHandler) CanHandle(msg tea.Msg) bool
func (h *PageNavigationHandler) Handle(m AppModel, msg tea.Msg) (AppModel, []tea.Cmd)

type QuitKeyHandler

type QuitKeyHandler struct{}

QuitKeyHandler handles quit key messages

func (*QuitKeyHandler) CanHandle

func (h *QuitKeyHandler) CanHandle(msg tea.Msg) bool

func (*QuitKeyHandler) Handle

func (h *QuitKeyHandler) Handle(m AppModel, msg tea.Msg) (AppModel, []tea.Cmd)

type UpdateCheckHandler added in v0.7.0

type UpdateCheckHandler struct{}

UpdateCheckHandler handles update check messages

func (*UpdateCheckHandler) CanHandle added in v0.7.0

func (h *UpdateCheckHandler) CanHandle(msg tea.Msg) bool

func (*UpdateCheckHandler) Handle added in v0.7.0

func (h *UpdateCheckHandler) Handle(m AppModel, msg tea.Msg) (AppModel, []tea.Cmd)

type UpdateCheckMsg added in v0.7.0

type UpdateCheckMsg struct {
	UpdateInfo *update.UpdateInfo
	Error      error
}

UpdateCheckMsg represents the result of an update check

type WindowSizeHandler

type WindowSizeHandler struct{}

WindowSizeHandler handles window size messages

func (*WindowSizeHandler) CanHandle

func (h *WindowSizeHandler) CanHandle(msg tea.Msg) bool

func (*WindowSizeHandler) Handle

func (h *WindowSizeHandler) Handle(m AppModel, msg tea.Msg) (AppModel, []tea.Cmd)

Directories

Path Synopsis
Package api provides an API client for the TUI.
Package api provides an API client for the TUI.
Package models contains the models for the TUI components.
Package models contains the models for the TUI components.

Jump to

Keyboard shortcuts

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