Documentation
¶
Overview ¶
Package tailnet reads this machine's Tailscale state and manages Tailscale Serve entries through the tailscale CLI, which works the same with every Tailscale variant (macOS app, Homebrew, Linux packages).
Index ¶
Constants ¶
const ( Missing = "missing" // the tailscale command was not found Stopped = "stopped" // installed, but not connected or its service is not running SignedOut = "signedOut" // waiting for a sign-in or the device's approval )
Why Tailscale is unavailable, so the dashboard can say what to do.
Variables ¶
ErrUnavailable means the tailscale CLI is missing or Tailscale is not connected.
Functions ¶
func Problem ¶ added in v0.2.0
Problem is the reason for an ErrUnavailable (Missing, Stopped or SignedOut), or "" for any other error.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache keeps the last status for a short while: identity checks run on every peer connection and must not spawn the CLI each time.
func Preloaded ¶
Preloaded returns a cache that always answers st, for callers (and tests) that already hold a status.
type Node ¶
type Node struct {
// Name is the device's host name, e.g. "devbox".
Name string `json:"name"`
// DNSName is the MagicDNS name without the trailing dot.
DNSName string `json:"dnsName"`
// Label is the first DNS label: a host name safe for URLs.
Label string `json:"label"`
OS string `json:"os"`
IPs []string `json:"-"`
Online bool `json:"-"`
Tagged bool `json:"-"`
UserID int64 `json:"-"`
}
Node is one device of the tailnet.
type ServeEntry ¶
type ServeEntry struct {
Served bool
// Target is the backend URL when the whole port goes to one backend;
// empty for anything else (TCP forwarding, several paths).
Target string
HTTPS bool
}
ServeEntry is how Tailscale Serve uses one port of this machine.
func ServeTarget ¶
ServeTarget reads how Tailscale Serve uses port on this machine.