podlogs

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: 11 Imported by: 0

Documentation

Overview

Package podlogs demonstrates Streamed data: a pod's log, read the way the Kubernetes API offers it — a tail, then a follow, and nothing else. There is no pagination and no offset, so it goes in a pkg/logview, with pkg/resume keeping reconnects exact (CLAUDE.md rule 34).

The fake kubelet here behaves like the real one where it matters:

  • It writes four lines a second, and "since" is truncated to the second, so a naive reconnect repeats up to three lines. resume.Tracker remembers how many it saw in the last second and drops exactly those.
  • The connection drops every 20 seconds. Each reconnect is marked in the log — lines written while it was down are fetched, but anything the kubelet rotated away in the meantime would be lost silently, and nothing can tell, so the marker says so rather than guessing.
  • The container restarts every 100 seconds. Follow ends with it; the new container's lines continue after a marker, and P opens the previous run on its own, never interleaved.
  • Only the newest minute (240 lines) is retained. O loads older lines by asking for a longer tail — which re-sends every newer line, so it is a key you press, never something scrolling does — until the start is reached.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the pod logs demo screen.

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