diag

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package diag reports the state of the plugin's endpoints for debugging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(dataDir string, w io.Writer) error

Run performs diagnostics on the tslink plugin state.

Types

type EndpointStatus

type EndpointStatus struct {
	ID           string    `json:"id"`
	ShortID      string    `json:"short_id"`
	StateDir     string    `json:"state_dir"`
	SocketExists bool      `json:"socket_exists"`
	StateExists  bool      `json:"state_exists"`
	TailscaleIP  string    `json:"tailscale_ip,omitempty"`
	Hostname     string    `json:"hostname,omitempty"`
	Online       bool      `json:"online"`
	BackendState string    `json:"backend_state,omitempty"`
	LastModified time.Time `json:"last_modified"`
	DebugLog     string    `json:"debug_log,omitempty"`
	Error        string    `json:"error,omitempty"`
}

EndpointStatus represents the health status of a single endpoint.

type Result

type Result struct {
	Timestamp     time.Time         `json:"timestamp"`
	DataDir       string            `json:"data_dir"`
	DataDirExists bool              `json:"data_dir_exists"`
	Endpoints     []*EndpointStatus `json:"endpoints"`
	NotRunning    []*StartStatus    `json:"not_running,omitempty"`
	Warned        []*StartStatus    `json:"warned,omitempty"`
	Summary       Summary           `json:"summary"`
}

Result represents the overall diagnostic result.

type StartStatus

type StartStatus struct {
	Endpoint string    `json:"endpoint"`
	Hostname string    `json:"hostname"`
	Stack    string    `json:"stack,omitempty"`
	State    string    `json:"state"`
	Error    string    `json:"error,omitempty"`
	Attempts int       `json:"attempts"`
	Updated  time.Time `json:"updated"`
	Warnings []Warning `json:"warnings,omitempty"`
}

StartStatus is an endpoint's status file, written by the plugin while the endpoint exists (see core.EndpointStatusFile).

type Summary

type Summary struct {
	Total    int `json:"total"`
	Online   int `json:"online"`
	Offline  int `json:"offline"`
	Errors   int `json:"errors"`
	Warnings int `json:"warnings"`
}

Summary provides a quick overview of endpoint health.

type Warning

type Warning struct {
	Key     string    `json:"key"`
	Message string    `json:"message"`
	Since   time.Time `json:"since"`
}

Warning is a condition of an endpoint that needs attention, from its status file (see core.StatusWarning).

Jump to

Keyboard shortcuts

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