Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(conn *websocket.Conn, errChan chan error) *Connection
func Upgrade ¶
func Upgrade(ctx *gin.Context, errChan chan error) (success bool, connection *Connection)
Upgrade 将HTTP连接升级为Websocket连接
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Read ¶
func (c *Connection) Read() <-chan []byte
func (*Connection) Write ¶
func (c *Connection) Write(jsonBytes []byte)
Click to show internal directories.
Click to hide internal directories.