Documentation
¶
Overview ¶
Package eventlog demonstrates pkg/eventlog over Seekable, Growing data: an AWX job's events, read over HTTP from demoapi's AWX-shaped endpoints (/api/v2/jobs/{id}/job_events/). Events are numbered by counter, carry 0 to n lines of stdout, and — while the job runs — keep arriving, some of them saved late. L cycles the server's latency.
The screen is bound with pkg/remote, so all it writes is the AWX client: page and find, two ordinary functions taking a context and a typed request. They are written the way a client of the real AWX would be:
- Unfiltered, a page is a counter range (counter__gt / counter__lte), and the total is the highest counter, not count — counters missing from the range are events not saved yet, shown as holes.
- Filtered, counters no longer line up with positions, so a page is AWX's page mode, and a search hit is turned into a position with one more request for count.
- A search asks for "the first match past this counter" (stdout__icontains, counter__gt, page_size=1).
- A running job is done when event_processing_finished says so, not when status does: the last events are saved after the job ends.
The routing between the view and its source — paging as you scroll, following, landing search hits, dropping replies nobody waits for — is the binding's.
New is a running job: following is on while the view is on the newest event; scroll up and it stops, the border counts what arrived since, and G returns. NewFinished is a job that has already ended — the troubleshooting case — opened at its first event: search (/, then n/N) walks the loaded events and, past them, asks AWX for the next match. Enter opens an event's fields in an inspector.
Index ¶
- func New(t theme.Theme) screen.Screen
- func NewFinished(t theme.Theme) screen.Screen
- type Screen
- 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
}