mtrtui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mtrtui drives the live MTR view via bubbletea. The model receives MTRUpdate messages from the probe goroutine and redraws the table on each frame.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProgram

func NewProgram(target string, cycles int, updates <-chan probe.MTRUpdate, opts render.Options) *tea.Program

NewProgram wires a tea.Program around the supplied channel.

func RunFallback

func RunFallback(ctx context.Context, target string, updates <-chan probe.MTRUpdate, opts render.Options) probe.MTRResult

RunFallback drives the same channel without a TUI: prints a header line, then one summary line per cycle. Suitable for non-TTY / piped stdout.

Types

type Model

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

Model is the bubbletea model for live MTR.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Snapshot

func (m Model) Snapshot() probe.MTRResult

Snapshot exposes the last MTR snapshot received by the model so the caller can print a persistent recap after the alt-screen program exits (otherwise the result is wiped when the terminal restores the main screen).

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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