Documentation
¶
Index ¶
- Constants
- Variables
- func Init()
- func ProgramOptions() []tea.ProgramOption
- 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 ¶
const MouseEnv = "SWARMCLI_MOUSE"
MouseEnv switches mouse capture off. It is on unless the variable says off in one of the spellings SWARMCLI_TELEMETRY accepts for off, so a value this does not recognise leaves the default alone. `:mouse` toggles it for a session.
Variables ¶
var BusinessEditionActive = func() bool { return edition == "be" }
BusinessEditionActive reports whether Business Edition is effectively active. The update notice uses it to decide 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 ProgramOptions ¶ added in v2.2.0
func ProgramOptions() []tea.ProgramOption
ProgramOptions are the tea.Program options a TUI entry point starts with: the alternate screen. Mouse capture is not among them, because the model switches it as views change (see syncMouse), so a build whose main passes only the alternate screen still gets the same mouse.
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.
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
func (*Model) Init ¶
Init will be automatically called by Bubble Tea if the model implements the Model interface and is passed into the tea.NewProgram function.
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.