端口分配时加锁;网关上线后保存平台恢复的节点与授权数据;现在新节点连接后会按需向平台报告更新

This commit is contained in:
2025-05-27 16:03:00 +08:00
parent c2dcae7af5
commit 48dba2c0c3
11 changed files with 137 additions and 135 deletions

18
gateway/core/edge.go Normal file
View File

@@ -0,0 +1,18 @@
package core
type Edge struct {
Id int32 `json:"id"`
Host *string `json:"host,omitempty"`
Port *uint16 `json:"port,omitempty"`
Prov *string `json:"prov,omitempty"`
City *string `json:"city,omitempty"`
Isp *string `json:"isp,omitempty"`
Status *int `json:"status,omitempty"`
Rtt *int `json:"rtt,omitempty"` // 节点响应时间,单位毫秒
Loss *int `json:"loss,omitempty"` // 节点丢包率,单位百分比
}
var (
EdgeOffline = 0
EdgeOnline = 1
)