feat: 基本广播服务

- 由Hub接收/push/{topic}的请求并解析信息体广播到对应的Client
This commit is contained in:
2025-12-17 14:49:59 +08:00
parent 53555a31c0
commit 1dbcc03e46
16 changed files with 245 additions and 191 deletions

View 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 != ""
}