tailscale

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tailscale is the Tier-1 discovery layer (PLAN §5.2): it shells `tailscale status --json` via PATH-based binary discovery (NOT the macOS-only Homebrew hardcode the Swift app used) and parses Self/Peer with TOTAL TOLERANCE — returning [] on missing-binary / non-zero exit / empty data / JSON shape drift, every field optional-defaulted, NEVER panicking on drift across Tailscale versions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindBinary

func FindBinary() (string, bool)

FindBinary returns the first tailscale binary from probeOrder, falling back to a $PATH lookup. It returns ("", false) when no binary is found (the caller then falls back to a manual host — PLAN §5.2).

func Resolve

func Resolve(name string) (ip string, ok bool)

Resolve maps a tailnet DNS-name or HostName to a 100.x address using Status(). A literal 100.x target resolves to itself. On Linux a DNS-name target requires the laptop to also run tailscale status; else only a literal 100.x is accepted (PLAN §5.2 R20). Returns ("", false) when unresolved.

Types

type Node

type Node struct {
	HostName     string
	DNSName      string
	OS           string
	Online       bool
	TailscaleIPs []string
}

Node is a discovered tailnet node, every field optional-defaulted so JSON shape drift degrades gracefully (PLAN §5.2).

func Status

func Status() ([]Node, error)

Status runs `tailscale status --json` and parses Self + Peers with total tolerance. It returns ([], nil) on ANY failure (missing binary, non-zero exit, empty data, JSON drift) — never an error the caller must special-case, never a panic (PLAN §5.2). The nil error keeps the caller's path simple: an empty slice means "no tailnet visible", and the caller falls back to a manual host / literal 100.x.

Jump to

Keyboard shortcuts

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