Documentation
¶
Overview ¶
Package liveops is the live-data showcase: everything that changes while you watch, on one screen, so a change that breaks an older feature shows up where you can see it.
┌ applications ──────────────────────┐┌ workloads ─────────────────────┐ │ demoapi over HTTP: per-row ││ pkg/metrics: Ratio, Badge, │ │ activity, marking, the verbs ││ Bar, Spark │ └────────────────────────────────────┘└────────────────────────────────┘ ┌ events ──────────────────────────────────────────────────────────────┐ │ what each poll changed, searchable │ └──────────────────────────────────────────────────────────────────────┘
What it exercises:
- One pkg/poll drives every pane (rule 24): each tick fetches the applications from demoapi and advances the workloads. Both tables swap their rows by key, so the cursor stays on its row while the order moves under it. The verbs on the workloads and events panes pause and resume the poll, refresh now, and change its cadence.
- Loading (rule 17): every pane shows its spinner until its first data lands, and "Reload" on the workloads pane clears it and shows it again.
- Row activity (rule 33) on the applications, against an API shaped like Argo CD. The server is the source of truth: rows spin because the server says so (demoapi schedules syncs of its own every few seconds), and when the user starts work the row is told at once. One decision per verb — who knows when the work ends: Sync is Observed (the POST answers at once; the phase says when it ends). Refresh is Held (a GET that blocks until reconciled and shows nothing meanwhile). Sync and follow is Held on a job handle it streams. Quick sync ends between two polls and is reported with UnobservedMsg. Fail a sync shows the failure path, and Sync (dropped) a job that was accepted and never ran.
- Reads that fail are reported once, and the title carries "reads failing" beside "refreshed Ns ago", which keeps counting.
- pkg/metrics' inline primitives in table cells, coloured with foreground-only escapes so the selected row's background runs through them (rule 19).
- A capped, searchable logview fed by what changed (rule 13).
- focus.Group over the three panes; keys go to the focused pane, the mouse and everything else to all of them (rule 6).
Index ¶
- func New(t theme.Theme) screen.Screen
- type Screen
- func (s *Screen) Actions() action.Set
- func (s *Screen) Help() []key.Binding
- func (s *Screen) HelpSections() []help.Section
- func (s *Screen) Init() tea.Cmd
- func (s *Screen) IsCapturingKeys() bool
- func (s *Screen) Layout() layout.Node
- func (s *Screen) OnEnter(any) tea.Cmd
- func (s *Screen) SetTheme(t theme.Theme)
- func (s *Screen) Title() string
- func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}
func (*Screen) Actions ¶
Actions satisfies action.Provider: the application verbs on the applications, and the poll's on the other two panes.