Documentation
¶
Index ¶
- Variables
- func Init()
- func RegisterPreUpdateHook(hook PreUpdateHook)
- func RegisterShutdownHook(fn func())
- func RenderBreadcrumbs(names []string, maxDisplay int) string
- func RunShutdownHooks()
- func SetDepsTransform(fn func(docker.Deps) docker.Deps)
- func SetEdition(e string)
- func SetStartupOverlay(o StartupOverlay)
- func SetVersion(v string)
- type Model
- type PreUpdateHook
- type StartupOverlay
Constants ¶
This section is empty.
Variables ¶
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.
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 ¶
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 ¶
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
type PreUpdateHook ¶
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.