Documentation ¶
Index ¶
- type FlyWSClient
- func (s *FlyWSClient) Close()
- func (s *FlyWSClient) ReadJSON(v interface{}) error
- func (s *FlyWSClient) SendBytes(data []byte) error
- func (s *FlyWSClient) SendJSON(data WS_Resp) error
- func (s *FlyWSClient) SendText(text string) error
- func (s *FlyWSClient) WriteJSON(v interface{}) error
- func (s *FlyWSClient) WriteMessage(data []byte) error
- type FlyWebSocketServer
- func (s *FlyWebSocketServer) Msg(key string, data interface{}, types string) WS_Resp
- func (s *FlyWebSocketServer) MsgBase64(key string, data []byte) WS_Resp
- func (s *FlyWebSocketServer) MsgJson(key string, data interface{}) WS_Resp
- func (s *FlyWebSocketServer) OnMsg(key string, ...)
- func (s *FlyWebSocketServer) SendAllClient(key string, data interface{})
- func (s *FlyWebSocketServer) SendBytesToAllClient(data []byte)
- func (s *FlyWebSocketServer) SendTextToAllClient(data string)
- func (s *FlyWebSocketServer) Start(server FlyAPIs.FlyApiServerBasicInterface, webroot string) (err error)
- type WS_Req
- type WS_Resp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlyWSClient ¶
type FlyWSClient struct { Conn *websocket.Conn StartAt time.Time IsClose bool // contains filtered or unexported fields }
func NewFlyWSClient ¶
func NewFlyWSClient(conn *websocket.Conn) *FlyWSClient
func (*FlyWSClient) Close ¶
func (s *FlyWSClient) Close()
func (*FlyWSClient) ReadJSON ¶
func (s *FlyWSClient) ReadJSON(v interface{}) error
func (*FlyWSClient) SendBytes ¶
func (s *FlyWSClient) SendBytes(data []byte) error
func (*FlyWSClient) SendJSON ¶
func (s *FlyWSClient) SendJSON(data WS_Resp) error
func (*FlyWSClient) SendText ¶
func (s *FlyWSClient) SendText(text string) error
func (*FlyWSClient) WriteJSON ¶
func (s *FlyWSClient) WriteJSON(v interface{}) error
func (*FlyWSClient) WriteMessage ¶
func (s *FlyWSClient) WriteMessage(data []byte) error
type FlyWebSocketServer ¶
type FlyWebSocketServer struct { Enable bool Debug bool Upgrader websocket.Upgrader Path string Clients map[string]*FlyWSClient // contains filtered or unexported fields }
func NewFlyWebSocketServer ¶
func NewFlyWebSocketServer() *FlyWebSocketServer
func (*FlyWebSocketServer) Msg ¶
func (s *FlyWebSocketServer) Msg(key string, data interface{}, types string) WS_Resp
func (*FlyWebSocketServer) MsgBase64 ¶
func (s *FlyWebSocketServer) MsgBase64(key string, data []byte) WS_Resp
func (*FlyWebSocketServer) MsgJson ¶
func (s *FlyWebSocketServer) MsgJson(key string, data interface{}) WS_Resp
func (*FlyWebSocketServer) OnMsg ¶
func (s *FlyWebSocketServer) OnMsg(key string, f func(key string, data interface{}, client *FlyWSClient, ws *FlyWebSocketServer) interface{})
func (*FlyWebSocketServer) SendAllClient ¶
func (s *FlyWebSocketServer) SendAllClient(key string, data interface{})
func (*FlyWebSocketServer) SendBytesToAllClient ¶
func (s *FlyWebSocketServer) SendBytesToAllClient(data []byte)
func (*FlyWebSocketServer) SendTextToAllClient ¶
func (s *FlyWebSocketServer) SendTextToAllClient(data string)
func (*FlyWebSocketServer) Start ¶
func (s *FlyWebSocketServer) Start(server FlyAPIs.FlyApiServerBasicInterface, webroot string) (err error)
Click to show internal directories.
Click to hide internal directories.