domain

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolVersion = 1

Variables

This section is empty.

Functions

func EdgeID

func EdgeID(a, b string) (id, source, target string)

Types

type AcceptedTraffic

type AcceptedTraffic struct {
	EdgeID     string
	SourceID   string
	TargetID   string
	ObserverID string
	AToBBytes  int64
	BToABytes  int64
	ReceivedAt time.Time
}

type EdgeHistory

type EdgeHistory struct {
	EdgeID              string               `json:"edgeId"`
	Source              HistoryNodeReference `json:"source"`
	Target              HistoryNodeReference `json:"target"`
	From                time.Time            `json:"from"`
	To                  time.Time            `json:"to"`
	BucketDurationMS    int64                `json:"bucketDurationMs"`
	Traffic             []TrafficBucket      `json:"traffic"`
	PathAnchor          *PathEvent           `json:"pathAnchor,omitempty"`
	PathEvents          []PathEvent          `json:"pathEvents"`
	TrafficTruncated    bool                 `json:"trafficTruncated"`
	PathEventsTruncated bool                 `json:"pathEventsTruncated"`
}

type EdgeState

type EdgeState string
const (
	EdgeActive EdgeState = "active"
	EdgeRecent EdgeState = "recent"
)

type HistoryEdgePage

type HistoryEdgePage struct {
	Edges      []HistoryEdgeSummary `json:"edges"`
	NextCursor string               `json:"nextCursor,omitempty"`
}

type HistoryEdgeQuery

type HistoryEdgeQuery struct {
	Window HistoryWindow
	NodeID string
	Path   PathKind
	Cursor string
	Limit  int
}

type HistoryEdgeSummary

type HistoryEdgeSummary struct {
	EdgeID        string               `json:"edgeId"`
	Source        HistoryNodeReference `json:"source"`
	Target        HistoryNodeReference `json:"target"`
	LastTrafficAt time.Time            `json:"lastTrafficAt"`
	AToBBytes     int64                `json:"aToBBytes"`
	BToABytes     int64                `json:"bToABytes"`
	Paths         []PathKind           `json:"paths"`
}

type HistoryMetadata

type HistoryMetadata struct {
	Nodes     []TopologyNode
	Redirects map[string]string
}

type HistoryNodeReference

type HistoryNodeReference struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	Hostname string `json:"hostname,omitempty"`
	DNSName  string `json:"dnsName,omitempty"`
	OS       string `json:"os,omitempty"`
}

type HistoryNodes

type HistoryNodes struct {
	Nodes []HistoryNodeReference `json:"nodes"`
}

type HistoryWindow

type HistoryWindow string
const (
	History15Minutes HistoryWindow = "15m"
	History1Hour     HistoryWindow = "1h"
	History6Hours    HistoryWindow = "6h"
	History24Hours   HistoryWindow = "24h"
	History7Days     HistoryWindow = "7d"
)

func (HistoryWindow) Duration

func (window HistoryWindow) Duration() time.Duration

func (HistoryWindow) Resolution

func (window HistoryWindow) Resolution() time.Duration

func (HistoryWindow) Valid

func (window HistoryWindow) Valid() bool

type NodeIdentity

type NodeIdentity struct {
	StableNodeID string   `json:"stableNodeId"`
	NodeID       string   `json:"nodeId,omitempty"`
	NodeKey      string   `json:"nodeKey,omitempty"`
	DiscoKey     string   `json:"discoKey,omitempty"`
	Hostname     string   `json:"hostname"`
	DNSName      string   `json:"dnsName,omitempty"`
	OS           string   `json:"os,omitempty"`
	TailscaleIPs []string `json:"tailscaleIps,omitempty"`
}

func (NodeIdentity) CanonicalID

func (n NodeIdentity) CanonicalID() string

func (NodeIdentity) DisplayName

func (n NodeIdentity) DisplayName() string

func (NodeIdentity) HasIdentity

func (n NodeIdentity) HasIdentity() bool

func (NodeIdentity) IdentityKey

func (n NodeIdentity) IdentityKey() string

type ObservationProvenance

type ObservationProvenance struct {
	ObserverID  string          `json:"observerId"`
	Path        PathObservation `json:"path"`
	CollectedAt time.Time       `json:"collectedAt"`
	ReceivedAt  time.Time       `json:"receivedAt"`
	ClockSkewed bool            `json:"clockSkewed"`
}

type ObserverReport

type ObserverReport struct {
	Observer            NodeIdentity      `json:"observer"`
	InventoryGeneration string            `json:"inventoryGeneration"`
	Peers               []PeerObservation `json:"peers,omitempty"`
}

type ObserverState

type ObserverState struct {
	ID              string    `json:"id"`
	Hostname        string    `json:"hostname"`
	Online          bool      `json:"online"`
	LastSeen        time.Time `json:"lastSeen"`
	LastCollectedAt time.Time `json:"lastCollectedAt"`
	ClockSkewMS     int64     `json:"clockSkewMs"`
	ClockSkewed     bool      `json:"clockSkewed"`
}

type PathEvent

type PathEvent struct {
	ObservedAt   time.Time               `json:"observedAt"`
	Path         PathObservation         `json:"path"`
	Observations []ObservationProvenance `json:"observations"`
}

type PathKind

type PathKind string
const (
	PathDirect    PathKind = "direct"
	PathDERP      PathKind = "derp"
	PathPeerRelay PathKind = "peer_relay"
	PathUnknown   PathKind = "unknown"
)

type PathObservation

type PathObservation struct {
	Kind                  PathKind `json:"kind"`
	DirectEndpoint        string   `json:"directEndpoint,omitempty"`
	DERPRegion            string   `json:"derpRegion,omitempty"`
	PeerRelayStableNodeID string   `json:"peerRelayStableNodeId,omitempty"`
}

func (PathObservation) Equal

func (p PathObservation) Equal(other PathObservation) bool

type PathTransition

type PathTransition struct {
	EdgeID       string
	ObservedAt   time.Time
	Path         PathObservation
	Observations []ObservationProvenance
}

type PeerObservation

type PeerObservation struct {
	Peer             NodeIdentity    `json:"peer"`
	RxBytes          int64           `json:"rxBytes"`
	TxBytes          int64           `json:"txBytes"`
	RxDelta          int64           `json:"rxDelta"`
	TxDelta          int64           `json:"txDelta"`
	SampleDurationMS int64           `json:"sampleDurationMs"`
	Path             PathObservation `json:"path"`
	LastActive       time.Time       `json:"lastActive"`
}

type RelaySessionObservation

type RelaySessionObservation struct {
	Relay               NodeIdentity `json:"relay"`
	Source              NodeIdentity `json:"source"`
	Target              NodeIdentity `json:"target"`
	SessionID           string       `json:"sessionId"`
	VNI                 int64        `json:"vni"`
	SourceEndpoint      string       `json:"sourceEndpoint,omitempty"`
	TargetEndpoint      string       `json:"targetEndpoint,omitempty"`
	SourceToTargetBytes int64        `json:"sourceToTargetBytes"`
	TargetToSourceBytes int64        `json:"targetToSourceBytes"`
	SourceToTargetDelta int64        `json:"sourceToTargetDelta"`
	TargetToSourceDelta int64        `json:"targetToSourceDelta"`
	SampleDurationMS    int64        `json:"sampleDurationMs"`
	LastActive          time.Time    `json:"lastActive"`
}

func (RelaySessionObservation) Validate

func (s RelaySessionObservation) Validate() error

type ReportEnvelope

type ReportEnvelope struct {
	Version            int                       `json:"version"`
	ReportID           string                    `json:"reportId"`
	ReporterInstanceID string                    `json:"reporterInstanceId"`
	Sequence           int64                     `json:"sequence"`
	CollectedAt        time.Time                 `json:"collectedAt"`
	Kind               ReportKind                `json:"kind"`
	Observers          []ObserverReport          `json:"observers,omitempty"`
	RelaySessions      []RelaySessionObservation `json:"relaySessions,omitempty"`
}

func (ReportEnvelope) Validate

func (r ReportEnvelope) Validate() error

type ReportKind

type ReportKind string
const (
	ReportObserverHello      ReportKind = "observer_hello"
	ReportInventoryUpdate    ReportKind = "inventory_update"
	ReportTrafficSample      ReportKind = "traffic_sample"
	ReportObserverHeartbeat  ReportKind = "observer_heartbeat"
	ReportRelaySessionUpdate ReportKind = "relay_session_update"
)

type ReportReceipt

type ReportReceipt struct {
	Accepted             bool     `json:"accepted"`
	ResyncRequired       bool     `json:"resyncRequired"`
	ControlStableNodeIDs []string `json:"controlStableNodeIds"`
	HeartbeatIntervalMS  int64    `json:"heartbeatIntervalMs"`
}

type Topology

type Topology struct {
	GeneratedAt  time.Time       `json:"generatedAt"`
	NextChangeAt *time.Time      `json:"nextChangeAt,omitempty"`
	Nodes        []TopologyNode  `json:"nodes"`
	Edges        []TopologyEdge  `json:"edges"`
	Observers    []ObserverState `json:"observers"`
}

type TopologyEdge

type TopologyEdge struct {
	ID                 string                  `json:"id"`
	Source             string                  `json:"source"`
	Target             string                  `json:"target"`
	Path               PathObservation         `json:"path"`
	State              EdgeState               `json:"state"`
	AToBBytesPerSecond float64                 `json:"aToBBytesPerSecond"`
	BToABytesPerSecond float64                 `json:"bToABytesPerSecond"`
	LastActive         time.Time               `json:"lastActive"`
	Observations       []ObservationProvenance `json:"observations"`
	Conflicts          []PathObservation       `json:"conflicts,omitempty"`
}

type TopologyNode

type TopologyNode struct {
	NodeIdentity
	ID             string    `json:"id"`
	Observable     bool      `json:"observable"`
	Online         bool      `json:"online"`
	LastEvidenceAt time.Time `json:"lastEvidenceAt"`
	ClockSkewed    bool      `json:"clockSkewed"`
}

type TrafficBucket

type TrafficBucket struct {
	BucketStart time.Time `json:"bucketStart"`
	AToBBytes   int64     `json:"aToBBytes"`
	BToABytes   int64     `json:"bToABytes"`
}

Jump to

Keyboard shortcuts

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