Help us shape the future of Go! Take the 2026 Go Developer Survey

livetui

package
v1.3.101 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package livetui cmd/skywire-cli/cliutil/livetui/livetui.go c4-vis-cli helper. Wraps any function that produces a string in a scrollable view that re-renders on a configurable tick, watch(1)-style, without rewriting the whole screen each tick.

Build a Refresh callback that returns the snapshot to show now and pass it to Run with an interval. Run blocks until q, Esc or Ctrl+C. The view scrolls independently of new frames, and stays at the end when it was there. It is drawn with progkit, so in websh the snapshot is also laid over the cells as selectable text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(refresh Refresh, opts Options) error

Run blocks running the view until the user quits.

Types

type Options

type Options struct {
	// Title shown in the header. Defaults to "skywire live".
	Title string
	// Interval between Refresh calls. Defaults to 1s.
	Interval time.Duration
}

Options tunes a Run invocation. All fields are optional.

type Refresh

type Refresh func(ctx context.Context) (string, error)

Refresh produces the snapshot to display on each tick. ctx is canceled when the user quits. Errors are shown in the header, and the loop goes on, so a transient error can be watched recovering.

Jump to

Keyboard shortcuts

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