Documentation ¶
Overview ¶
Package etui provides an "ephemeral" terminal user interface to display the application state dynamically. The terminal is placed into raw mode and the cursor is manipulated to allow for a dynamic, multi-line UI (provided by the jotframe lib), for this reason all other application mechanisms that write to the screen must be suppressed before starting (such as logs); since bytes in the device and in application memory combine to make a shared state, bytes coming from elsewhere to the screen will disrupt this state.
This UI is primarily driven off of events from the event bus, creating single-line terminal widgets to represent a published element on the event bus, typically polling the element for the latest state. This allows for the UI to control update frequency to the screen, provide "liveness" indications that are interpolated between bus events, and overall loosely couple the bus events from screen interactions.
By convention, all elements published on the bus should be treated as read-only, and publishers on the bus should attempt to enforce this when possible by wrapping complex objects with interfaces to prescribe interactions. Also by convention, each new event that the UI should respond to should be added either in this package as a handler function, or in the shared ui package as a function on the main handler object. All handler functions should be completed processing an event before the ETUI exits (coordinated with a sync.WaitGroup)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OutputToEphemeralTUI ¶
nolint:funlen,gocognit OutputToEphemeralTUI is a UI function that provides a terminal UI experience without a separate, in-application screen buffer. All logging is suppressed, buffered to a string, and output after the ETUI has been torn down.
Types ¶
This section is empty.