端口分配时加锁;网关上线后保存平台恢复的节点与授权数据;现在新节点连接后会按需向平台报告更新
This commit is contained in:
18
gateway/core/edge.go
Normal file
18
gateway/core/edge.go
Normal 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
|
||||
)
|
||||
Reference in New Issue
Block a user