tailscale: Add runtime exit node API

This commit is contained in:
世界
2026-05-21 12:37:15 +08:00
parent 715e5c4c2b
commit 9afbd45d4b
9 changed files with 329 additions and 78 deletions
+3
View File
@@ -5,6 +5,7 @@ import "context"
type TailscaleEndpoint interface {
SubscribeTailscaleStatus(ctx context.Context, fn func(*TailscaleEndpointStatus)) error
StartTailscalePing(ctx context.Context, peerIP string, fn func(*TailscalePingResult)) error
SetTailscaleExitNode(ctx context.Context, stableID string) error
}
type TailscalePingResult struct {
@@ -22,6 +23,7 @@ type TailscaleEndpointStatus struct {
NetworkName string
MagicDNSSuffix string
Self *TailscalePeer
ExitNode *TailscalePeer
UserGroups []*TailscaleUserGroup
}
@@ -34,6 +36,7 @@ type TailscaleUserGroup struct {
}
type TailscalePeer struct {
StableID string
HostName string
DNSName string
OS string