Documentation
¶
Index ¶
- type WSCfg
- type WSClient
- type WSModule
- func (ws *WSModule) Close(clientId string)
- func (ws *WSModule) GetClientHeader(clientId string, key string) string
- func (ws *WSModule) GetClientIp(clientId string) string
- func (ws *WSModule) GetProcessor() processor.IRawProcessor
- func (ws *WSModule) Init(wsCfg *WSCfg, process processor.IRawProcessor)
- func (ws *WSModule) NewWSClient(conn *network.WSConn) network.Agent
- func (ws *WSModule) OnInit() error
- func (ws *WSModule) SendMsg(clientId string, msg interface{}) error
- func (ws *WSModule) SendRawMsg(clientId string, msg []byte) error
- func (ws *WSModule) SetMessageType(messageType int)
- func (ws *WSModule) Start() error
- type WSPack
- type WSPackType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WSModule ¶
type WSModule struct {
service.Module
WSServer network.WSServer
// contains filtered or unexported fields
}
func (*WSModule) GetClientHeader ¶
func (*WSModule) GetClientIp ¶
func (*WSModule) GetProcessor ¶
func (ws *WSModule) GetProcessor() processor.IRawProcessor
func (*WSModule) SetMessageType ¶
type WSPack ¶
type WSPack struct {
Type WSPackType //0表示连接 1表示断开 2表示数据
MsgProcessor processor.IRawProcessor
ClientId string
Data any
}
type WSPackType ¶
type WSPackType int8
const ( WPTConnected WSPackType = 0 WPTDisConnected WSPackType = 1 WPTPack WSPackType = 2 WPTUnknownPack WSPackType = 3 )
Click to show internal directories.
Click to hide internal directories.