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 ¶
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 ¶
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 ¶
Node is a discovered tailnet node, every field optional-defaulted so JSON shape drift degrades gracefully (PLAN §5.2).
func Status ¶
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.