554325746@qq.com
2020-02-04 fe0d2a7aec5984d0931ab81e1af4921fb2c6f83c
pubsub.go
@@ -2,12 +2,15 @@
type PubSub interface {
   Publish([]byte)
   Publish(Message)
   Surveyor() []string
   Recv() chan Message
}
type Message struct {
   Id string
   Topic string
   Msg []byte
}
@@ -16,6 +19,7 @@
   Topic_Camera = "camera"  //摄像机消息
   Topic_Task = "task" //任务消息
   Topic_Sdk = "sdk" //算法消息
    Topic_RuleProc = "ruleProcess" //ruleProcess消息
   Topic_Event = "event" //事件消息
)
@@ -26,4 +30,4 @@
//processId is process Identifier,unique
func NewSubscriber(url string,heartBeatUrl string,mode int,topics []string,processId string) (PubSub,error) {
   return newSub(url,heartBeatUrl, topics, processId)
}
}