Files
mayfly-go/server/pkg/ws/msg.go

20 lines
270 B
Go
Raw Normal View History

package ws
2023-09-12 20:54:07 +08:00
// 消息类型
type MsgType uint8
2023-09-12 20:54:07 +08:00
const (
JsonMsg MsgType = 1
TextMsg MsgType = 2
BinaryMsg MsgType = 3
)
// 消息信息
type Msg struct {
ToUserId UserId // 用户id
ToClientId string // 客户端id
2023-09-12 20:54:07 +08:00
Type MsgType // 消息类型
Data any
2023-09-12 20:54:07 +08:00
}