diag

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Overview

Package diag provides local diagnostics: the `doctor` environment report, a sanitized diagnostic bundle for bug reports, and the redaction used to keep any optional excerpt free of obvious secrets. Pane content can contain secrets, so the bundle omits content by default and redacts it when explicitly included.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redact

func Redact(s string) string

Redact replaces secret-shaped substrings with a placeholder.

Types

type Bundle

type Bundle struct {
	Generated       string   `json:"generated_at"`
	Doctor          Report   `json:"doctor"`
	RecentEvents    []string `json:"recent_events"`
	ExcerptIncluded bool     `json:"excerpt_included"`
	Excerpt         string   `json:"excerpt,omitempty"`
	Note            string   `json:"note"`
}

Bundle is a sanitized diagnostic bundle for bug reports. It contains the doctor report and recent local debug-log events. It contains NO pane content by default; an excerpt is included only when the caller explicitly opts in, and even then it is run through Redact.

func BuildBundle

func BuildBundle(muxrayVersion, generatedAt string, includeExcerpt bool, excerpt string) Bundle

BuildBundle assembles a sanitized bundle. When includeExcerpt is true the provided excerpt is redacted and attached; otherwise no content is included.

type Check

type Check struct {
	Name   string `json:"name"`
	OK     bool   `json:"ok"`
	Detail string `json:"detail"`
}

Check is a single named diagnostic with a pass/fail and a human detail.

type Report

type Report struct {
	MuxrayVersion       string  `json:"muxray_version"`
	OS                  string  `json:"os"`
	Arch                string  `json:"arch"`
	TmuxFound           bool    `json:"tmux_found"`
	TmuxVersion         string  `json:"tmux_version,omitempty"`
	InsideTmux          bool    `json:"inside_tmux"`
	SnapshotDir         string  `json:"snapshot_dir"`
	SnapshotDirWritable bool    `json:"snapshot_dir_writable"`
	ConfigPath          string  `json:"config_path"`
	ConfigExists        bool    `json:"config_exists"`
	TelemetryKillSwitch bool    `json:"telemetry_kill_switch"`
	TelemetryExternal   bool    `json:"telemetry_external_enabled"`
	Checks              []Check `json:"checks"`
}

Report is the doctor output.

func Doctor

func Doctor(muxrayVersion string) Report

Doctor collects local environment diagnostics. version is passed in to avoid an import cycle with the version package.

Jump to

Keyboard shortcuts

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