etui

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

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

func OutputToEphemeralTUI(workerErrs <-chan error, subscription *partybus.Subscription) error

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.

Jump to

Keyboard shortcuts

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