Versions in this module Expand all Collapse all v0 v0.1.0 Aug 30, 2026 Changes in this version + const DefaultControlURL + const DefaultTransportID + var ErrAlreadyStarted = errors.New("tailscale: client already started") + var ErrClosed = errors.New("tailscale: client closed") + var ErrControlNodeKeyMismatch = errors.New(...) + var ErrInteractionNotFound = errors.New("tailscale: interaction not found") + var ErrNodeIdentityChanged = errors.New("tailscale: cached node identity does not match the wgo device") + var ErrNodeKeyExpired = errors.New(...) + var ErrNotStarted = errors.New("tailscale: client not started") + var ErrPeerConflict = errors.New("tailscale: peer public key is already owned by another wgo controller") + var ErrPeerNotFound = errors.New("tailscale: peer not found") + var ErrZeroNodeKey = errors.New("tailscale: wgo device has no private node key") + type ACLDestination struct + Bits *int + IP string + Ports PortRange + type ACLRule struct + CapabilityGrants []json.RawMessage + Destinations []ACLDestination + IPProtocols []int + SourceBits []int + SourceIPs []string + type ACLView struct + NamedRules map[string][]ACLRule + Revision uint64 + Rules []ACLRule + func (view ACLView) FirewallConfig() *gonnect.FirewallConfig + type CacheCallbacks struct + Load func(context.Context) ([]byte, error) + Store func(context.Context, []byte) error + type Client struct + func New(network gonnect.Network, dev WGODevice, options Options) (*Client, error) + func (c *Client) ACL() ACLView + func (c *Client) ACLAllows(source, destination netip.Addr, protocol int, port uint16) bool + func (c *Client) ACLFirewallConfig() *gonnect.FirewallConfig + func (c *Client) Close() error + func (c *Client) ConfirmPeer(ctx context.Context, id string) error + func (c *Client) CurrentInteraction() *Interaction + func (c *Client) DERP() DERPView + func (c *Client) DNS() DNSView + func (c *Client) DesiredNetworkConfiguration() NetworkConfiguration + func (c *Client) Done() <-chan struct{} + func (c *Client) Info() ClientInfo + func (c *Client) Peer(id string) (PeerInfo, bool) + func (c *Client) Peers() []PeerInfo + func (c *Client) Resolver() *MagicDNSResolver + func (c *Client) ResumeInteraction(id uint64) error + func (c *Client) RevokePeerConfirmation(ctx context.Context, id string) error + func (c *Client) Snapshot() Snapshot + func (c *Client) Start(parent context.Context) error + func (c *Client) State() State + func (c *Client) Subscribe(buffer int) (<-chan Event, func()) + func (c *Client) Wait() error + type ClientInfo struct + AuthenticatedAt time.Time + BackendLogID string + CapabilityVersion int + ControlURL string + DiscoPublicKey string + DisplayName string + Ephemeral bool + Hostname string + LoginName string + MachineAuthorized bool + MachinePublicKey string + MapSequence int64 + MapSessionHandle string + NodePublicKey device.NoisePublicKey + PeerConfirmation bool + PreferredDERP int64 + ProfilePicURL string + StartedAt time.Time + TransportID device.TransportID + UserID int64 + type ConfirmationState string + const PeerAwaitingConfirmation + const PeerConfirmationNotRequired + const PeerConfirmed + type DERPLatencySource string + const DERPLatencyHTTPS + const DERPLatencySTUN + type DERPNode struct + CertName string + DERPPort int + HostName string + IPv4 string + IPv6 string + InsecureForTests bool + Name string + RegionID int64 + STUNOnly bool + STUNPort int + STUNTestIP string + type DERPRegion struct + Code string + ID int64 + Latency time.Duration + LatencyMeasuredAt time.Time + LatencySource DERPLatencySource + Latitude float64 + Longitude float64 + Name string + NoMeasureNoHome bool + Nodes []DERPNode + type DERPView struct + Home int64 + Regions []DERPRegion + Revision uint64 + type DNSRecord struct + Name string + Type string + Value string + type DNSView struct + CertDomains []string + Nameservers []netip.Addr + Proxied bool + Records []DNSRecord + Resolvers []json.RawMessage + Revision uint64 + Routes map[string][]json.RawMessage + SearchDomains []string + type Event struct + At time.Time + Err error + Kind EventKind + Revision uint64 + type EventKind string + const EventACL + const EventDERP + const EventDNS + const EventError + const EventInteraction + const EventMetadata + const EventNetwork + const EventPeerPath + const EventPeers + const EventSelf + const EventState + const EventUsers + type Interaction struct + ID uint64 + Kind InteractionKind + Message string + Since time.Time + URL string + type InteractionKind string + const InteractionAuthenticate + const InteractionControlURL + const InteractionNodeKeyExpired + type LocalEndpoint struct + Address netip.AddrPort + Source string + type MagicDNSResolver struct + func (r *MagicDNSResolver) LookupAddr(ctx context.Context, address string) ([]string, error) + func (r *MagicDNSResolver) LookupHost(ctx context.Context, host string) ([]string, error) + func (r *MagicDNSResolver) LookupNetIP(ctx context.Context, network, host string) ([]netip.Addr, error) + type NetworkConfiguration struct + Addresses []netip.Prefix + DNS DNSView + InterfaceName string + MTU int + Revision uint64 + Routes []Route + Up bool + type NodeInfo struct + Addresses []netip.Prefix + AllowedIPs []netip.Prefix + Capabilities []string + CapabilityMap map[string][]json.RawMessage + CapabilityVersion int + ComputedName string + ComputedNameWithHost string + Created time.Time + DataPlaneAuditLogID string + DiscoPublicKey string + Endpoints []netip.AddrPort + ExitNodeDNSResolvers []json.RawMessage + Expired bool + HomeDERP int64 + HostinfoJSON json.RawMessage + ID int64 + IsJailed bool + IsWireGuardOnly bool + KeyExpiry time.Time + KeySignature []byte + LastSeen *time.Time + LegacyDERPString string + MachineAuthorized bool + MachinePublicKey string + Name string + Online *bool + PrimaryRoutes []netip.Prefix + PublicKey device.NoisePublicKey + RawJSON json.RawMessage + SelfNodeV4MasqAddrForThisPeer *netip.Addr + SelfNodeV6MasqAddrForThisPeer *netip.Addr + SharerID int64 + StableID string + Tags []string + UnsignedPeerAPIOnly bool + UserID int64 + type Options struct + AuthKey string + AuthenticationPollInterval time.Duration + Cache CacheCallbacks + ConfirmPeers bool + ControlURL string + DisableDERP bool + DisableDiscovery bool + Ephemeral bool + Hostname string + InterfaceName string + ListenPort uint16 + Logger *slog.Logger + MTU int + Obfuscation *device.AmneziaWGConfig + ReconnectMax time.Duration + ReconnectMin time.Duration + TLSConfig *tls.Config + TransportID device.TransportID + UseDefaultTransportForDirectPeers bool + type PathKind string + const PathDERP + const PathDirect + const PathNone + type PeerInfo struct + AppliedToWGO bool + Confirmation ConfirmationState + Direct netip.AddrPort + LastError string + Node NodeInfo + Path PathKind + PathLatency time.Duration + PathUpdated time.Time + PeerID string + type PortRange struct + First uint16 + Last uint16 + type Route struct + PeerID string + PeerPublicKey device.NoisePublicKey + Prefix netip.Prefix + Primary bool + type Snapshot struct + ACL ACLView + At time.Time + Client ClientInfo + ControlTime *time.Time + DERP DERPView + DNS DNSView + Domain string + Health []string + Interaction *Interaction + LastError string + LocalEndpoints []LocalEndpoint + Network NetworkConfiguration + Peers []PeerInfo + Revision uint64 + Self *NodeInfo + State State + Users []UserProfile + type State string + const StateDegraded + const StateNeedsAuthentication + const StateNew + const StateRunning + const StateStarting + const StateStopped + const StateStopping + type UserProfile struct + DisplayName string + Groups []string + ID int64 + LoginName string + ProfilePicURL string + type WGODevice interface + AddTransport func(device.TransportID, device.TransportConfig) error + DeletePeer func(device.NoisePublicKey) (bool, error) + PeerSpec func(device.NoisePublicKey) (device.PeerSpec, bool) + PrivateKey func() device.NoisePrivateKey + RemoveTransport func(device.TransportID) error + UpsertPeer func(device.PeerSpec) error