app

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BusinessEditionActive = func() bool { return edition == "be" }

BusinessEditionActive reports whether Business Edition is effectively active. The update notice uses it to choose the install link and whether to show the "try Business Edition" hint. It defaults to the static build edition flag, so the CE binary always reports false (and shows the hint). BE overrides it from its live license state — so an unlicensed BE binary, which already presents as Community Edition throughout the UI, also shows the hint, while a licensed one suppresses it.

View Source
var StackBarSuffix string

StackBarSuffix is optional right-aligned text on the breadcrumb bar. Set from init() to display persistent status (e.g., license mode).

Functions

func Init

func Init()

Init should be called once at the start of the application to initialize logging.

func RegisterPreUpdateHook

func RegisterPreUpdateHook(hook PreUpdateHook)

RegisterPreUpdateHook adds a hook. Must be called from init().

func RegisterShutdownHook

func RegisterShutdownHook(fn func())

RegisterShutdownHook adds a function to run when the program exits. Must be called from init(). Hooks run synchronously in registration order from RunShutdownHooks, which the entry point invokes after tea.Program.Run returns. They also fire from a SIGINT/SIGTERM handler set up by callers that need defensive cleanup on panic paths.

func RenderBreadcrumbs

func RenderBreadcrumbs(names []string, maxDisplay int) string

RenderBreadcrumbs produces the breadcrumb bar string from a list of view names. Top-level views show only their own name. Nested views are trimmed to the nearest top-level ancestor, then capped at maxDisplay items (with "…" prefix).

func RunShutdownHooks

func RunShutdownHooks()

RunShutdownHooks executes all registered shutdown hooks in order. Safe to call multiple times; hooks themselves must be idempotent.

func SetDepsTransform

func SetDepsTransform(fn func(docker.Deps) docker.Deps)

SetDepsTransform registers a function that transforms the default Deps before they are stored in the Model. Must be called before InitialModel(). Used by extension builds to wrap Deps interfaces with middleware.

func SetEdition

func SetEdition(e string)

SetEdition sets the application edition (called from main).

func SetStartupOverlay

func SetStartupOverlay(o StartupOverlay)

SetStartupOverlay registers a startup overlay. Must be called from init().

func SetVersion

func SetVersion(v string)

SetVersion sets the application version (called from main)

Types

type Model

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

Model holds app state

func InitialModel

func InitialModel() *Model

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init will be automatically called by Bubble Tea if the model implements the Model interface and is passed into the tea.NewProgram function.

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type PreUpdateHook

type PreUpdateHook func(viewName string, msg tea.Msg) (handled bool, cmd tea.Cmd)

PreUpdateHook can intercept messages before the core Update dispatch. Return handled=true to stop processing; the returned cmd is used. Return handled=false to let the message continue to core Update.

type StartupOverlay

type StartupOverlay interface {
	Active() bool
	Update(tea.Msg) tea.Cmd
	View() string
}

StartupOverlay is a component displayed on top of the initial TUI view. While Active, the app routes KeyMsg exclusively to its Update and composites its View on top of the rendered output.

Jump to

Keyboard shortcuts

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