Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpHandler ¶
type StaticFileHandler ¶
type WSClient ¶
type WSClient struct { OnConnect func(*websocket.Conn) OnDisconnect func(*websocket.Conn) OnReadMessage func(message *Message) OnWriteMessage func(message *Message) OnError func(error) // contains filtered or unexported fields }
func (*WSClient) Disconnect ¶
func (w *WSClient) Disconnect()
func (*WSClient) SendObject ¶
func (w *WSClient) SendObject(message interface{})
type WSHandler ¶
type WSHandler struct {
// contains filtered or unexported fields
}
func NewWSHandler ¶
func NewWSHandler(textMessageHandler WSMessageHandler, binaryMessageHandler WSMessageHandler) *WSHandler
NewWSHandler NewHandler create web socket handler
func (*WSHandler) AddReceiveMessageHandler ¶
type WSMessageHandler ¶ added in v0.0.3
type WSServer ¶
type WSServer struct { // on connect OnConnect func(*WSSession) // on disconnect OnDisconnect func(*WSSession) // contains filtered or unexported fields }
WSServer WebSocket Server
func NewWSServer ¶
func NewWSServer(addr string, wsHandler *WSHandler, staticFile *StaticFileHandler, httpHandlers ...*HttpHandler) *WSServer
func (*WSServer) MsgHandler ¶
func (*WSServer) RunWithTLS ¶
type WSSession ¶
type WSSession struct { // network Server *WSServer // The web socket connection. Conn *websocket.Conn // user context UserContext interface{} // contains filtered or unexported fields }
func (*WSSession) SendMessage ¶
func (*WSSession) SendString ¶
Click to show internal directories.
Click to hide internal directories.