eventlog

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 20 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the demo over a job that is still running.

func NewFinished

func NewFinished(t theme.Theme) screen.Screen

NewFinished returns the demo over a job that has already finished.

Types

type Screen

type Screen struct {
	// contains filtered or unexported fields
}

func (*Screen) Help

func (s *Screen) Help() []key.Binding

func (*Screen) HelpSections

func (s *Screen) HelpSections() []help.Section

func (*Screen) Init

func (s *Screen) Init() tea.Cmd

func (*Screen) IsCapturingKeys

func (s *Screen) IsCapturingKeys() bool

func (*Screen) Layout

func (s *Screen) Layout() layout.Node

func (*Screen) OnEnter

func (s *Screen) OnEnter(any) tea.Cmd

func (*Screen) SetTheme

func (s *Screen) SetTheme(t theme.Theme)

func (*Screen) Title

func (s *Screen) Title() string

func (*Screen) Update

func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)

Jump to

Keyboard shortcuts

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