Documentation
¶
Overview ¶
Package polltable demonstrates pkg/poll driving auto-refresh of a table.Model, with SetKeyedRows pinning the cursor to the same row by Key across every refresh.
The synthetic data is a deployments table — fixed set of services, each with a Sync state, Health state, replica count, and "age". On every tick the underlying state mutates (a deployment flips Syncing → Synced, a Health goes Degraded → Healthy or vice versa, replica counts drift, ordering changes), and the table is re-applied via SetKeyedRows. Because each row carries a stable deployment ID, the cursor sticks even when the row's display position moves — the payoff that "keyed rows for auto-refresh" makes visible.
Keys: p pauses/resumes, r refreshes immediately, +/- adjust cadence, /↑↓ behave normally on the table, [/]/s sort by column.
Index ¶
- func New(t theme.Theme) screen.Screen
- type Screen
- func (s *Screen) Help() []key.Binding
- 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
}