Documentation ¶
Index ¶
- Constants
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func Notice(format string, v ...interface{})
- func SetLogger(l logger)
- func Warning(format string, v ...interface{})
- type WSClient
- type WSHandle
- type WSMessage
- type WSMessageType
- type WSServerHandler
- type WSServerInterface
Constants ¶
View Source
const ( // for business message WSMessageTypeBusiness = WSMessageType(1) // for control message (close connection) WSMessageTypeClose = WSMessageType(2) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
func (*WSClient) RefreshReconnectMsg ¶
RefreshReconnectMsg can refresh the client's reconnect message
func (*WSClient) SendMessge ¶
type WSHandle ¶
type WSHandle uint64
WSHandle means a websocket connection
func (WSHandle) SendMessage ¶
SendMessge ,send a message to chan
type WSMessage ¶
type WSMessage struct { // Type determine the message is business message or not Type WSMessageType // Data save the concrete datas for translation Data []byte }
type WSMessageType ¶
type WSMessageType int64
type WSServerHandler ¶
type WSServerHandler struct {
On WSServerInterface
}
func (*WSServerHandler) OnHandler ¶
func (ws *WSServerHandler) OnHandler(w http.ResponseWriter, r *http.Request)
OnHandler contains a connection and open a routine for recv
Click to show internal directories.
Click to hide internal directories.