Documentation ¶
Overview ¶
* @Author: * @Date: 2022-12-21 12:39:14 * @LastEditors: Please set LastEditors * @LastEditTime: 2022-12-23 11:23:36 * @Description:
Index ¶
- type Connection
- type Hub
- func (h *Hub) GetToConn(group, connId string) (*Connection, bool)
- func (h *Hub) Listen(c *Connection, messageHandler func(messageType int, message []byte)) error
- func (h *Hub) Open(group, connId string, res http.ResponseWriter, req *http.Request) (*Connection, error)
- func (h *Hub) RemoveConn(c *Connection)
- func (h *Hub) RemoveGroup(groupName string)
- func (h *Hub) WriteEveryGroupOneConn(messageType int, message []byte) error
- func (h *Hub) WriteOnConn(c *Connection, messageType int, message []byte) error
- func (h *Hub) WriteOnGroup(group string, messageType int, message []byte)
- func (h *Hub) WriteOneConn(group string, messageType int, message []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Hub ¶
type Hub struct { Upgrader *websocket.Upgrader WriteWait time.Duration PongWait time.Duration PingPeriod time.Duration MaxMessageSize int64 // contains filtered or unexported fields }
func (*Hub) Listen ¶
func (h *Hub) Listen(c *Connection, messageHandler func(messageType int, message []byte)) error
func (*Hub) Open ¶
func (h *Hub) Open(group, connId string, res http.ResponseWriter, req *http.Request) (*Connection, error)
func (*Hub) RemoveConn ¶
func (h *Hub) RemoveConn(c *Connection)
func (*Hub) RemoveGroup ¶
func (*Hub) WriteEveryGroupOneConn ¶
func (*Hub) WriteOnConn ¶
func (h *Hub) WriteOnConn(c *Connection, messageType int, message []byte) error
func (*Hub) WriteOnGroup ¶
Click to show internal directories.
Click to hide internal directories.