mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-11 17:47:20 +10:00
tools: Tailscale status
This commit is contained in:
@@ -2,8 +2,18 @@ package adapter
|
||||
|
||||
import "context"
|
||||
|
||||
type TailscaleStatusProvider interface {
|
||||
type TailscaleEndpoint interface {
|
||||
SubscribeTailscaleStatus(ctx context.Context, fn func(*TailscaleEndpointStatus)) error
|
||||
StartTailscalePing(ctx context.Context, peerIP string, fn func(*TailscalePingResult)) error
|
||||
}
|
||||
|
||||
type TailscalePingResult struct {
|
||||
LatencyMs float64
|
||||
IsDirect bool
|
||||
Endpoint string
|
||||
DERPRegionID int32
|
||||
DERPRegionCode string
|
||||
Error string
|
||||
}
|
||||
|
||||
type TailscaleEndpointStatus struct {
|
||||
@@ -12,8 +22,15 @@ type TailscaleEndpointStatus struct {
|
||||
NetworkName string
|
||||
MagicDNSSuffix string
|
||||
Self *TailscalePeer
|
||||
Users map[int64]*TailscaleUser
|
||||
Peers []*TailscalePeer
|
||||
UserGroups []*TailscaleUserGroup
|
||||
}
|
||||
|
||||
type TailscaleUserGroup struct {
|
||||
UserID int64
|
||||
LoginName string
|
||||
DisplayName string
|
||||
ProfilePicURL string
|
||||
Peers []*TailscalePeer
|
||||
}
|
||||
|
||||
type TailscalePeer struct {
|
||||
@@ -30,10 +47,3 @@ type TailscalePeer struct {
|
||||
UserID int64
|
||||
KeyExpiry int64
|
||||
}
|
||||
|
||||
type TailscaleUser struct {
|
||||
ID int64
|
||||
LoginName string
|
||||
DisplayName string
|
||||
ProfilePicURL string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user