Versions in this module Expand all Collapse all v0 v0.4.0 Aug 29, 2026 Changes in this version + const FeatureMultiObserver + const FeatureObserverWithdrawal + const ProtocolVersion + const RelayDisabled + const RelayEnabled + const RelayIdentityAvailable + const RelayIdentityDegraded + const RelayOff + const RelayTransientFailure + const RelayUnsupported + var ErrDuplicateRegistration = errors.New("exporter registration key already exists") + var ErrSnapshotSinkRunning = errors.New("snapshot sink is already running") + var ErrSnapshotSinkStopped = errors.New("snapshot sink is not running") + type Capabilities struct + Features []string + ObserverProtocolVersions []int + func (c Capabilities) SupportsFeature(feature string) bool + func (c Capabilities) SupportsProtocol(version int) bool + type HTTPReporter struct + func NewHTTPReporter(serverURL string, client *http.Client) (*HTTPReporter, error) + func (r *HTTPReporter) Capabilities(ctx context.Context) (Capabilities, error) + func (r *HTTPReporter) RequireCapabilities(ctx context.Context, features ...string) error + func (r *HTTPReporter) Send(ctx context.Context, report ReportEnvelope) (ReportReceipt, error) + type HTTPStatusError struct + Message string + Status string + StatusCode int + func (e *HTTPStatusError) Error() string + type IncompatibleServerError struct + Reason string + func (e *IncompatibleServerError) Error() string + type NodeIdentity struct + DNSName string + DiscoKey string + Hostname string + NodeID string + NodeKey string + OS string + StableNodeID string + TailscaleIPs []string + func (n NodeIdentity) CanonicalID() string + func (n NodeIdentity) DisplayName() string + func (n NodeIdentity) HasIdentity() bool + func (n NodeIdentity) IdentityKey() string + type ObserverReport struct + CollectedAt *time.Time + InventoryGeneration string + Observer NodeIdentity + Peers []PeerObservation + type Path struct + DERPRegion string + DirectEndpoint string + Kind PathKind + PeerRelayStableNodeID string + PeerRelayVNI *int64 + func (p Path) Equal(other Path) bool + type PathKind string + const PathDERP + const PathDirect + const PathPeerRelay + const PathUnknown + type PeerObservation struct + LastActive time.Time + Path Path + Peer NodeIdentity + RxBytes int64 + RxDelta int64 + SampleDurationMS int64 + TxBytes int64 + TxDelta int64 + type PeerSnapshot struct + Identity NodeIdentity + Path Path + RxBytes int64 + TxBytes int64 + type Registration struct + func (r *Registration) Key() string + func (r *Registration) Withdraw(ctx context.Context) error + type RelayCapability string + type RelayClientSnapshot struct + BytesSent uint64 + DiscoShort string + Endpoint string + Identity *NodeIdentity + PacketsSent uint64 + SessionClientID string + type RelayIdentityEvidence string + type RelaySessionClient struct + DiscoShort string + Endpoint string + Identity *NodeIdentity + SessionClientID string + type RelaySessionObservation struct + LastActive time.Time + Relay NodeIdentity + SampleDurationMS int64 + SessionID string + Source RelaySessionClient + SourceToTargetBytes int64 + SourceToTargetDelta int64 + Target RelaySessionClient + TargetToSourceBytes int64 + TargetToSourceDelta int64 + VNI int64 + type RelaySessionSnapshot struct + SessionID string + Source RelayClientSnapshot + Target RelayClientSnapshot + VNI int64 + type RelaySnapshot struct + Capability RelayCapability + CollectedAt time.Time + IdentityEvidence RelayIdentityEvidence + Sessions []RelaySessionSnapshot + type RelaySource interface + PeerRelaySnapshot func(context.Context) (RelaySnapshot, error) + type ReportEnvelope struct + CollectedAt time.Time + Kind ReportKind + Observers []ObserverReport + RelaySessions []RelaySessionObservation + ReportID string + ReporterInstanceID string + Sequence int64 + Version int + type ReportKind string + const ReportInventoryUpdate + const ReportObserverHeartbeat + const ReportObserverHello + const ReportObserverWithdrawal + const ReportRelaySessionUpdate + const ReportTrafficSample + type ReportReceipt struct + Accepted bool + ControlStableNodeIDs []string + HeartbeatIntervalMS int64 + ResyncRequired bool + type Reporter interface + Capabilities func(context.Context) (Capabilities, error) + Send func(context.Context, ReportEnvelope) (ReportReceipt, error) + type Snapshot struct + CollectedAt time.Time + Observer NodeIdentity + Peers []PeerSnapshot + type SnapshotSink struct + func NewSnapshotSink(reporter Reporter, options SnapshotSinkOptions) *SnapshotSink + func (s *SnapshotSink) Register(key string, source Source) (*Registration, error) + func (s *SnapshotSink) Run(ctx context.Context) error + type SnapshotSinkOptions struct + Logger *slog.Logger + ReporterInstanceID string + type Source interface + Snapshot func(context.Context) (Snapshot, error)