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

clivisor

package
v1.3.97 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package clivisor is the output shape of the `skywire cli visor` commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bandwidth

type Bandwidth struct {
	// Event marks the last record of the stream; see BandwidthProgress.
	Event         string  `json:"event,omitempty"`
	Carrier       string  `json:"carrier,omitempty"`
	Target        string  `json:"target"`
	Seconds       float64 `json:"seconds"`
	BytesSent     uint64  `json:"bytes_sent"`
	BytesReceived uint64  `json:"bytes_received"`
	UploadKBps    float64 `json:"upload_kbps"`
	DownloadKBps  float64 `json:"download_kbps"`
	UploadMbps    float64 `json:"upload_mbps"`
	DownloadMbps  float64 `json:"download_mbps"`
}

Bandwidth is the result of a bandwidth test: the totals a caller wants, rather than the six formatted lines the command printed.

Both units are given for the speeds. The human rendering showed KB/s and Mbps side by side, and dropping either would make a caller recompute a number it had already been shown.

func (Bandwidth) Human

func (b Bandwidth) Human(w io.Writer) error

Human writes the final-results block the command printed.

type BandwidthProgress

type BandwidthProgress struct {
	// Event names the record so a reader consuming the stream can tell a
	// sample from the final summary without guessing by field presence.
	Event        string  `json:"event"`
	Seconds      float64 `json:"seconds"`
	UploadKBps   float64 `json:"upload_kbps"`
	DownloadKBps float64 `json:"download_kbps"`
}

BandwidthProgress is one sample of a bandwidth test in flight.

These stream: a long run emits one JSON object per line (NDJSON) followed by the Bandwidth summary, matching what `visor ping mux-bw` and `visor ping tree-stream` already do. Suppressing them in JSON mode would leave a caller watching a multi-minute test with nothing to read until the end, while the terminal user sees it tick — the wrong way round, since the caller is the one that cannot see a progress line rewrite itself.

func (BandwidthProgress) Human

func (p BandwidthProgress) Human(w io.Writer) error

Human writes the in-place progress line the terminal shows.

type Goroutines

type Goroutines struct {
	Total   int    `json:"total"`
	Summary string `json:"summary,omitempty"`
	Dump    string `json:"dump,omitempty"`
}

Goroutines is a visor's goroutine census.

Dump is the raw runtime stack text, carried as one field rather than parsed into structure: it is Go's own format, a caller wanting it wants it verbatim, and inventing a schema over it would be a second thing to keep correct.

func (Goroutines) Human

func (g Goroutines) Human(w io.Writer) error

Human writes whichever rendering was asked for.

Jump to

Keyboard shortcuts

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