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

clilog

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

Documentation

Overview

Package clilog cmd/skywire-cli/commands/log/dmsghttp_client.go c4-vis-cli

Shared dmsg-bootstrap + http-client helper for the per-visor survey-whitelist endpoints. Pre-fix, every subcommand that reached out over dmsghttp had to re-implement the SK resolution, dmsg bootstrap, and transport-pool wiring inline. This file centralizes that boilerplate so `cli log info|file|level|pprof|stats| uptime|reward` share one resolution policy + one dmsg client.

Endpoints reached this way are all gated by the remote visor's survey_whitelist (see pkg/visor/logserver/api.go:131-208 — the `authRoute` group). The CLI's local PK is what gets allowlisted; no per-request signing, so SK loading just selects which PK we authenticate AS.

Package clilog cmd/skywire-cli/commands/log/log.go c4-vis-cli

Package clilog cmd/skywire-cli/commands/log/root.go c4-vis-cli

Package clilog cmd/skywire-cli/commands/log/single_heapdump.go c4-vis-cli

`cli log heapdump <pk>` — ask a remote visor to write a full heap dump to its own disk. The dump itself is never sent over dmsg.

Package clilog cmd/skywire-cli/commands/log/single_loglevel.go c4-vis-cli

`cli log level <pk> [level]` — read or set a remote visor's log level for a while, over dmsghttp. Visors run at info; this turns on debug for the one visor being looked at, while `cli log file <pk> -f` streams it.

Package clilog cmd/skywire-cli/commands/log/single_node_info.go c4-vis-cli

`cli log info <pk>` — fetch a single visor's /node-info JSON over dmsghttp. Distinct from the bulk-collection mode at the `cli log` root (no subcommand), which iterates the entire uptime tracker and writes per-visor folders. This one-shot mode is for ad-hoc inspection: target one visor, dump the survey to stdout.

Package clilog cmd/skywire-cli/commands/log/single_pprof.go c4-vis-cli

`cli log pprof <pk> <profile>` — fetch one of the remote visor's pprof profiles over dmsghttp and emit the raw bytes to stdout. Direct equivalent of `go tool pprof http://<host>/debug/pprof/<profile>` but routed through the survey_whitelist gate.

Package clilog cmd/skywire-cli/commands/log/single_reward.go c4-vis-cli

`cli log reward <pk>` — fetch the remote visor's /reward.txt file over dmsghttp. Only exists when the operator has set a reward address on the visor.

Package clilog cmd/skywire-cli/commands/log/single_stats.go c4-vis-cli

`cli log stats <pk> [path]` — fetch the remote visor's /stats[/path] endpoint over dmsghttp. Stats is a typed telemetry store; consult the visor's logserver for the available paths (the bare `stats` call returns the index).

Package clilog cmd/skywire-cli/commands/log/single_uptime.go c4-vis-cli

`cli log uptime <pk> [path]` — fetch the remote visor's /uptime[/path] endpoint over dmsghttp. Like /stats this is a typed telemetry store; bare `uptime` returns the index.

Package clilog cmd/skywire-cli/commands/log/single_visor_log.go c4-vis-cli

`cli log file <pk>` — stream a single visor's /visor.log over dmsghttp. Requires the remote visor to have been started with -s/--save-log; without that flag, the endpoint returns 404 and this command surfaces a clear hint.

Filtering flags translate to URL query params that the remote visor applies server-side before streaming — avoids pulling the whole file just to grep it locally over a slow dmsg/skynet hop.

Package clilog cmd/skywire-cli/commands/log/st.go c4-vis-cli

Package clilog cmd/skywire-cli/commands/log/tplogs.go c4-vis-cli

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = logCmd

RootCmd is logCmd

Functions

func CancellableCopy

func CancellableCopy(ctx context.Context, w io.Writer, body io.ReadCloser, length int64) (int64, error)

CancellableCopy will call the Reader and Writer interface multiple time, in order to copy by chunk (avoiding loading the whole file in memory).

Types

type ProgressWriter

type ProgressWriter struct {
	// atomic requires 64-bit alignment for struct field access
	Current int64
	Total   int64
}

ProgressWriter prints the progress of a download to stdout.

func (*ProgressWriter) Write

func (pw *ProgressWriter) Write(p []byte) (int, error)

Write implements io.Writer

type VisorUptimeResponse

type VisorUptimeResponse struct {
	PubKey     string  `json:"pk"`
	Uptime     float64 `json:"up"`
	Downtime   float64 `json:"down"`
	Percentage float64 `json:"pct"`
	Online     bool    `json:"on"`
	Version    string  `json:"version"`
}

VisorUptimeResponse represents visor uptime data.

Jump to

Keyboard shortcuts

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