From c7069befa28a0f2594f0746044318a30d6989c19 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期日, 25 四月 2021 11:36:03 +0800 Subject: [PATCH] 使用bhsgo by lichao --- message.go | 45 ++++++--------------------------------------- 1 files changed, 6 insertions(+), 39 deletions(-) diff --git a/message.go b/message.go index 9ba85b9..9ce78da 100644 --- a/message.go +++ b/message.go @@ -35,8 +35,8 @@ ) type NodeList struct { - Ip string `json:"ip"` - Port int `json:"port"` + Ip string `json:"ip"` + Port int `json:"port"` } const ( @@ -60,43 +60,10 @@ } type RegisterInfo struct { - Proc ProcInfo `json:"proc"` // 杩涚▼鐨勪俊鎭� - Channel []string `json:"channel"` // 鏂板棰戦亾锛屽搴斾竴涓柊鐨勫叡浜唴瀛橀槦鍒� - PubTopic []string `json:"pubTopic"` // 杩涚▼瀵瑰鍙戝竷鐨勬湇鍔′富棰� - SubTopic []string `json:"subTopic"` // 杩涚▼璁㈤槄鐨勬湇鍔′富棰� -} - - -type RegisterReply struct { - TCPProxyIP string `json:"tcpProxyIP"` // BHomeCenter鍚姩鐨則cp浠g悊鏈嶅姟鍣↖P - TCPProxyPort int `json:"tcpProxyPort"` // BHomeCenter鍚姩鐨則cp浠g悊鏈嶅姟鍣ㄧ鍙� - HeartbeatKey int `json:"heartbeatKey"` // client鍙戦�佸績璺崇殑key - ReplyKey int `json:"replyKey"` // client鐨勫簲绛旀湇鍔ey - ChannelKey map[string]int `json:"channelKey"` // client鐨刢han瀵瑰簲鐨刱ey - QueryTopicKey int `json:"queryTopicKey"` // client鏌ヨtopic瀵瑰簲鐨刱ey鏃剁敤鍒扮殑key - Status int `json:"status"` // 璇锋眰鐘舵��,鐩墠鍙湁涓や釜,鎴愬姛杩斿洖200,澶辫触202 -} - -type HeartBeatInfo struct { - Proc ProcInfo `json:"proc"` // 杩涚▼鐨勪俊鎭� - HealthLevel string `json:"healthLevel"` // 鍋ュ悍绛夌骇 - Fps int `json:"fps"` // 澶勭悊甯х巼(dec瑙g爜甯х巼銆乻dk澶勭悊甯х巼) - WarnInfo string `json:"warnInfo"` // 鎶ヨ淇℃伅 - ErrorInfo string `json:"errorInfo"` // 閿欒淇℃伅 - OtherInfo []byte `json:"otherInfo"` // 鍏朵粬鐗规湁淇℃伅锛屽鏈夐渶瑕佸氨鐢ㄨ繖涓� - OtherInfoSize int `json:"otherInfoSize"` // 鍏朵粬鐗规湁淇℃伅闀垮害 -} - -type HeartBeatReply struct { - Status int `json:"status"` // 璇锋眰鐘舵��,鐩墠鍙湁涓や釜,鎴愬姛杩斿洖200,澶辫触202 - Desc string `json:"desc"` // 璇锋眰鐘舵�佺殑鎻忚堪,鎴愬姛"success",澶辫触杩斿洖澶辫触鍘熷洜,濡傚績璺虫湇鍔℃湭鍚姩 -} - -type MsgInfo struct { - SrcProc ProcInfo `json:"srcProc"` // 婧愯繘绋嬪熀鏈俊鎭� - MsgType string `json:"msgType"` // 鏁版嵁绫诲瀷锛屽彲涓鸿姹傘�佸彂甯冦�佽闃呫�佸簲绛旂瓑 - Topic string `json:"topic"` // 璇锋眰鐨勫嚱鏁�,骞朵笉瀵瑰簲浠讳綍鐨剆hmKey,涓氬姟灞傜殑topic - Body []byte `json:"body"` // 璇锋眰鍐呭 + Proc ProcInfo `json:"proc"` // 杩涚▼鐨勪俊鎭� + Channel []string `json:"channel"` // 鏂板棰戦亾锛屽搴斾竴涓柊鐨勫叡浜唴瀛橀槦鍒� + PubTopic []string `json:"pubTopic"` // 杩涚▼瀵瑰鍙戝竷鐨勬湇鍔′富棰� + SubTopic []string `json:"subTopic"` // 杩涚▼璁㈤槄鐨勬湇鍔′富棰� } -- Gitblit v1.8.0