feat: 基本广播服务
- 由Hub接收/push/{topic}的请求并解析信息体广播到对应的Client
This commit is contained in:
17
interval/protocol/types.go
Normal file
17
interval/protocol/types.go
Normal file
@ -0,0 +1,17 @@
|
||||
package protocol
|
||||
|
||||
type MessageType string
|
||||
|
||||
const (
|
||||
MsgInit MessageType = "init"
|
||||
MsgSubscribe MessageType = "subscribe"
|
||||
MsgUnsubscribe MessageType = "unsubscribe"
|
||||
MsgBroadcast MessageType = "broadcast"
|
||||
MsgError MessageType = "error"
|
||||
)
|
||||
|
||||
type Topic string
|
||||
|
||||
func (t Topic) Valid() bool {
|
||||
return t != ""
|
||||
}
|
||||
Reference in New Issue
Block a user