Documentation
¶
Index ¶
- Variables
- func AppendAndSort(listMe, listYou []ws.Trainer) (res []ws.Result)
- func AppendList(list []ws.Trainer, from string) (res []ws.Result)
- func FindMany(database string, id string, sendId string, pageSize int) []ws.Result
- func InsertMsg(database string, id string, content string, read uint, expire int64) error
- func WriteMessage(client *Client, msgType int, code int, content string, from string)
- func WsHandler(c *gin.Context)
- type Broadcast
- type Client
- type ClientManager
- type Message
- type ReplyMsg
- type SendMsg
- type UserRegisterService
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func WriteMessage ¶
Types ¶
type ClientManager ¶
type ClientManager struct { Clients map[string]*Client Broadcast chan *Broadcast Reply chan *Client Register chan *Client Unregister chan *Client }
ClientManager 用户管理
func (*ClientManager) Start ¶
func (manager *ClientManager) Start()
type Message ¶
type Message struct { Sender string `json:"sender,omitempty"` Recipient string `json:"recipient,omitempty"` Content string `json:"content,omitempty"` }
Message 信息转JSON (包括:发送者、接收者、内容)
type ReplyMsg ¶
type ReplyMsg struct { From string `json:"from"` Code int `json:"code"` Content string `json:"content"` }
ReplyMsg 回复的消息
type UserRegisterService ¶
type UserRegisterService struct { NickName string `form:"nick_name" json:"nick_name" binding:"required,min=1,max=10"` Password string `form:"password" json:"password" binding:"required,min=6,max=10"` }
func (*UserRegisterService) Register ¶
func (us *UserRegisterService) Register() serializer.Response
Click to show internal directories.
Click to hide internal directories.